123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Dynamic;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess
- {
- public partial class OnSingleFirstFormMain : LYFZ.Software.UI.DoorCityProcess.OnSingleFirstFormMain
- {
- public OnSingleFirstFormMain()
- {
- this.Load += OnSingleFirstFormMain_Load;
- this.btnWedding.Click += btnWedding_Click;
- this.btnChild.Click += btnChild_Click;
- this.btnPortrait.Click += btnPortrait_Click;
- this.btnService.Click += btnService_Click;
- this.btnWeddingCelebration.Click += btnWeddingCelebration_Click;
- this.FormClosed += OnSingleFirstFormMain_FormClosed;
- #region
- ////方法1,有子级需要转KeyValuePair<string, object>然后再转换为Dictionary<string, object>
- //LYFZ.BLL.BLL_ErpCustomersTrackRecord bll = new BLL.BLL_ErpCustomersTrackRecord();
- //LYFZ.Command.Result<dynamic> ResultList = (LYFZ.Command.Result<dynamic>)bll.GetCallCenterGouTongType();
- //string StrII = "";
- //foreach (dynamic item in ResultList.Data)
- //{
- // System.Collections.Generic.KeyValuePair<string, object> dyc = item;
- // dynamic dys = (dynamic)dyc.Value;
- // StrII += dys.GouTongType + ":";
- // dynamic dyss = (dynamic)dys.GouTongList;
- // Dictionary<string, object> dyc2 = dyss;
- // foreach (dynamic items in dyc2.Values)
- // {
- // StrII += items.ItemCode + "-" + items.ItemText + ",";
- // }
- // StrII += "\r\n";
- //}
- //MessageBox.Show(StrII);
- ////方法2,无子级直接获取动态库值
- //LYFZ.BLL.BLL_ErpCustomersTrackRecord bll = new BLL.BLL_ErpCustomersTrackRecord();
- //LYFZ.Command.Result<dynamic> ResultList = (LYFZ.Command.Result<dynamic>)bll.GetCallCenterGouTongMethod();
- //string StrII = "";
- //foreach (dynamic item in ResultList.Data)
- //{
- // StrII += item.GouTongMethod + ",";
- //}
- //MessageBox.Show(StrII);
- ////方法3,综合以上两种,判断是否有子级
- //LYFZ.BLL.BLL_ErpCustomersTrackRecord bll = new BLL.BLL_ErpCustomersTrackRecord();
- //LYFZ.Command.Result<dynamic> ResultList = (LYFZ.Command.Result<dynamic>)bll.GetCallCenterGouTongType();
- //string StrII = "";
- //foreach (dynamic item in ResultList.Data)
- //{
- // string strD = item.GetType().Name;
- // if (strD.IndexOf("KeyValuePair") != -1)
- // {
- // System.Collections.Generic.KeyValuePair<string, object> dyc = item;
- // dynamic dys = (dynamic)dyc.Value;
- // StrII += dys.GouTongType + ":";
- // dynamic dyss = (dynamic)dys.GouTongList;
- // //string strD = item.GetType().Name;//获取动态库item的类型是需要转换成为KeyValuePair还是转换为Dictionary
- // //if (strD.IndexOf("KeyValuePair") != -1)
- // //{
- // // System.Collections.Generic.KeyValuePair<string, object> dycs = dyss;
- // //}
- // //else
- // //{ Dictionary<string, object> dycss = dyss; }
- // Dictionary<string, object> dyc2 = dyss;
- // foreach (dynamic items in dyc2.Values)
- // {
- // StrII += items.ItemCode + "-" + items.ItemText + ",";
- // }
- // StrII += "\r\n";
- // }
- // else
- // {
- // StrII += item.GouTongMethod + ",";
- // }
- //}
- //MessageBox.Show(StrII);
- #endregion
- }
- /// <summary>
- /// 是否为外部调用
- /// </summary>
- public bool IsExternalCalls = false;
- string _StrNumber = "";
- /// <summary>
- /// 订单号
- /// </summary>
- public string StrNumber {
- set { _StrNumber = value; }
- get { return _StrNumber; }
- }
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 是否要跳转界面
- /// </summary>
- bool IsGoForm = false;
- /// <summary>
- /// 是否显示写真版
- /// </summary>
- private bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
- LYFZ.EnumPublic.OrderType OrdType;
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFirstFormMain_Load(object sender, EventArgs e)
- {
- this.btnWedding.Visible = false;
- this.btnChild.Visible = false;
- this.btnPortrait.Visible = false;
- this.btnService.Visible = false;
- this.btnWeddingCelebration.Visible = false;
- int HodeCount = 0;
- switch (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
- {
- case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版:
- this.btnWedding.Visible = true;
- this.btnChild.Visible = true;
- if (IsPortrait)
- { this.btnPortrait.Visible = true; }
- this.btnService.Visible = true;
- this.btnWeddingCelebration.Visible = true;
- break;
- case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版:
- this.btnWedding.Visible = true;
- this.btnWeddingCelebration.Visible = true;
- if (IsPortrait)
- { this.btnPortrait.Visible = true; }
- this.btnService.Visible = true;
- HodeCount++;
- break;
- case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版:
- this.btnChild.Visible = true;
- if (IsPortrait)
- { this.btnPortrait.Visible = true; }
- this.btnService.Visible = true;
- HodeCount++;
- break;
- }
- if (!IsPortrait)
- { HodeCount++; }
- if (HodeCount > 0)
- { this.Width -= (this.btnWeddingCelebration.Width * HodeCount); }
- }
- /// <summary>
- /// 子窗体关闭后刷新父窗体
- /// </summary>
- public void RefreshParentForm()
- {
- this.IsGoForm = false;
- this.Close();
- }
- /// <summary>
- /// 婚纱
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnWedding_Click(object sender, EventArgs e)
- {
- this.Hide();
- this.OrdType = EnumPublic.OrderType.婚纱订单;
- this.IsGoForm = true;
- this.Close();
- }
- /// <summary>
- /// 儿童
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnChild_Click(object sender, EventArgs e)
- {
- this.Hide();
- this.OrdType = EnumPublic.OrderType.儿童订单;
- this.IsGoForm = true;
- this.Close();
- }
- /// <summary>
- /// 写真
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnPortrait_Click(object sender, EventArgs e)
- {
- this.Hide();
- this.OrdType = EnumPublic.OrderType.写真订单;
- this.IsGoForm = true;
- this.Close();
- }
- /// <summary>
- /// 服务
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnService_Click(object sender, EventArgs e)
- {
- this.Hide();
- this.OrdType = EnumPublic.OrderType.服务订单;
- this.IsGoForm = true;
- this.Close();
- }
- /// <summary>
- /// 婚庆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnWeddingCelebration_Click(object sender, EventArgs e)
- {
- this.Hide();
- this.OrdType = EnumPublic.OrderType.婚庆订单;
- this.IsGoForm = true;
- this.Close();
- }
- /// <summary>
- /// 窗体关闭后发生事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFirstFormMain_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (IsGoForm)
- {
- //#if DEBUG
- OpenNewOrder(OrdType);
- //#else
- // OpenOnSingleFormMain01(OrdType);
- //#endif
- }
- }
- /// <summary>
- /// 新版开单界面
- /// </summary>
- /// <param name="orderType"></param>
- void OpenNewOrder(EnumPublic.OrderType orderType)
- {
-
- frmNewOrder newOrder = new frmNewOrder();
- //测试打开订单
- //if (orderType == EnumPublic.OrderType.儿童订单)
- //{
- // newOrder.OrderNumber = "RT17111400003";
- //}
- //else if (orderType == EnumPublic.OrderType.婚纱订单)
- //{
- // newOrder.OrderNumber = "HS17051700005";
- //}
- newOrder.IsShowUcNavigationTool = false;
- newOrder.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- newOrder.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- newOrder.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- newOrder.OrderType = orderType;
- if (this.IsExternalCalls)
- {
- if (newOrder.ShowDialog() == DialogResult.OK)
- {
- this.IsSaveed = true;
- this.StrNumber = newOrder.OrderNumber;
- }
- }
- else
- {
- newOrder.Show();
- }
- }
- /// <summary>
- /// 旧版开单界面
- /// </summary>
- /// <param name="orderType"></param>
- void OpenOnSingleFormMain01(EnumPublic.OrderType orderType)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFormMain01 frm = new OnSingleFormMain01();
- frm.EnumLoadFormType = OnSingleFormMain01.LoadFormType.开单选择;
- frm.OrdType = OrdType;
- frm.IsShowUcNavigationTool = false;
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- if (this.IsExternalCalls)
- {
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- IsSaveed = frm.IsSaveed;
- this.StrNumber = frm.StrNumber;
- }
- }
- else
- { frm.Show(); }
- }
- }
- }
|