private void Search(SupplierAccountRecord record)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                skinLabelOrder.Text    = record.SourceOrderID;
                skinLabelOpreator.Text = record.AdminUserName;
                skinLabelSupplier.Text = GlobalCache.GetSupplierName(record.SupplierID);
                List <BoundDetail> listPage = GlobalCache.ServerProxy.
                                              GetDetail4SupplierAccountRecord(record.SourceOrderID);

                if (listPage != null)
                {
                    int     totalCount = 0;
                    decimal totalPrice = 0;
                    for (int i = 0; i < listPage.Count; i++)
                    {
                        totalCount += listPage[i].SumCount;
                        totalPrice += listPage[i].SumCost;
                    }
                    skinLabelCount.Text = totalCount.ToString();
                    skinLabelPrice.Text = totalPrice.ToString();
                    foreach (var item in listPage)
                    {
                        item.CostumeName = CommonGlobalCache.GetCostumeName(item.CostumeID);
                    }
                }

                this.dataGridViewPagingSumCtrl.BindingDataSource <BoundDetail>(DataGridViewUtil.ToDataTable(listPage));
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 2
0
        protected override T LoadAsset <T>(string assetPath)
        {
            if (typeof(T) == typeof(AssetBundle))
            {
                var ab = GlobalUtil.Binsearch(mAbs, HashAssetID(assetPath));
#if UNITY_EDITOR
                if (ab == null || ab.assetBundle == null)
                {
                    RTLog.LogErrorFormat(LogCat.Asset, "Faild to load AssetBundle[{0}], sync load ab only support for cached assets.", assetPath);
                }
#endif
                return(ab == null ? null : ab.assetBundle as T);
            }
            else
            {
                var meta   = GetOrNewMeta(assetPath);
                var holder = GetHandler(meta.Identify);
                if (holder != null)
                {
#if UNITY_EDITOR
                    RTLog.LogErrorFormat(LogCat.Asset, "Faild to load asset \"{0}\", because of another async loading of this asset.", assetPath);
#endif
                    return(null);
                }
                if (meta.assetInstence == null)
                {
                    if (!meta.useAb)
                    {
                        meta.assetInstence = Resources.Load <T>(assetPath);
                    }
                    else if (meta.abData != null && meta.abData.assetBundle != null)
                    {
                        meta.assetInstence = meta.abData.assetBundle.LoadAsset <T>(assetPath);
                    }
#if UNITY_EDITOR
                    RTLog.LogFormat(LogCat.Asset, "\"{0}\" was loaded(AssetBundle: {1}).",
                                    meta.assetPath, meta.abData == null ? "Unkown" : meta.abData.name);
#endif
                }
                return(meta.assetInstence as T);
            }
        }
Ejemplo n.º 3
0
        public ABAssetsUtil(AssetSetting set) : base()
        {
            mHandlers = new LinkedList <IAssetHandler>();
            mAssets   = new Dictionary <int, AssetMeta>(set.initCapacity);
            var ab = AssetBundle.LoadFromFile(Path.Combine(set.abFolder, set.manifestName));

            if (ab != null)
            {
                mManifest = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
            }
            if (mManifest == null)
            {
                RTLog.LogError(LogCat.Asset, "Lost AssetBundle Manifest File.");
                mAbs = new AbMeta[0];
            }
            else
            {
                var abs = mManifest.GetAllAssetBundles();
                mAbs = new AbMeta[abs == null ? 0 : abs.Length];
                for (int i = 0; i < mAbs.Length; i++)
                {
                    mAbs[i] = new AbMeta(this, abs[i], Path.Combine(set.abFolder, abs[i]));
                }
                GlobalUtil.Sort(mAbs, (x, y) => x.Identify <= y.Identify ? -1 : 1);
                for (int i = 0; i < mAbs.Length; i++)
                {
                    var dependencies = mManifest.GetAllDependencies(mAbs[i].name);
                    if (dependencies == null || dependencies.Length == 0)
                    {
                        continue;
                    }
                    for (int j = 0; j < dependencies.Length; j++)
                    {
                        var meta = GlobalUtil.Binsearch(mAbs, HashAssetID(dependencies[j]));
                        if (meta != null)
                        {
                            meta.AddReferenceTo(mAbs[i].Identify);
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void Initialize()
        {
            try
            {
                SetYear();
                setProperty();
                //  SetSize();
                // AutoInsertTitleImage();

                this.titleImageControlWidth1.Clear();
                if (CurItem != null)
                { //如果是编辑绑定所有显示,点击下拉时变更为有效的供应商选择
                    skinComboBox_SupplierID.EnabledSupplier = false;
                }
                else
                {
                    skinComboBox_SupplierID.EnabledSupplier = true;
                }

                colorComboBox1.Initialize();
                SetParameterConfig();
                this.dataGridView.AutoGenerateColumns = false;

                ColorList = new List <ListItem <String> >();

                Display();
                if (!DataGridViewUtil.CheckPerMission(this, RolePermissionMenuEnum.商品档案, RolePermissionEnum.查看_备注))
                {
                    this.skinTextBox_Remarks.Visible = false;
                    this.skinLabel16.Visible         = false;
                }
                else
                {
                    this.skinTextBox_Remarks.Visible = true;
                    this.skinLabel16.Visible         = true;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
        }
Ejemplo n.º 5
0
        private void Edit(CostumeColor item)
        {
            List <CostumeColor> list     = DataGridViewUtil.BindingListToList <CostumeColor>(dataGridView1.DataSource);
            AddCostumeColorForm AddBrand = new AddCostumeColorForm(item, OperationEnum.Edit);

            AddBrand.Text = "修改颜色";
            try
            {
                if (AddBrand.ShowDialog(this) == DialogResult.OK)
                {
                    item = AddBrand.Result;
                    InteractResult result = GlobalCache.ServerProxy.UpdateCostumeColor(item);
                    if (GlobalUtil.EngineUnconnectioned(this))
                    {
                        return;
                    }
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalCache.UpdateCostumeColor(item);
                        GlobalCache.LoadCostumeInfos();
                        baseButton1_Click(null, null);
                        break;

                    case ExeResult.Error:
                        GlobalMessageBox.Show(result.Msg);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 6
0
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                string path = CJBasic.Helpers.FileHelper.GetFileToOpen2("请选择要上传的图片", "提示", ".jpg", ".png", "jpeg", ".bmp");
                if (String.IsNullOrEmpty(path))
                {
                    photo = null;
                    return;
                }
                if (String.IsNullOrEmpty(path))
                {
                    GlobalMessageBox.Show("请选择文件!");
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                Image        img    = Image.FromFile(path);
                MemoryStream stream = new MemoryStream();
                img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                photo = stream.ToArray();

                Image map = JGNet.Core.ImageHelper.GetNewSizeImage(img, 800);
                // this.pictureBox1.Image = map;
                stream = new MemoryStream();
                map.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                photo = stream.ToArray();
                if (photo.Length > 2097152)
                {
                    GlobalMessageBox.Show("图片太大,请重新上传!");
                    return;
                }
            }
            catch (OutOfMemoryException ex) { GlobalUtil.ShowError("文件有损坏或内存不足!"); }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 7
0
        private void LoadConfig()
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                visitPara = GlobalCache.ServerProxy.GetGuideReturnVisitPara();
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 8
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex < 0 || e.ColumnIndex < 0)
         {
             return;
         }
         DataGridView view = sender as DataGridView;
         Role         role = view.Rows[e.RowIndex].DataBoundItem as Role;
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
Ejemplo n.º 9
0
 private void LoadTrack()
 {
     try
     {
         if (GlobalUtil.EngineUnconnectioned(this))
         {
             return;
         }
         list = GlobalCache.EMallServerProxy.GetEmRefundAddressList();
         this.BindingDataSource(list);
     }
     catch (Exception ee)
     {
         GlobalUtil.ShowError(ee);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
Ejemplo n.º 10
0
 private void Query()
 {
     try
     {
         if (GlobalUtil.EngineUnconnectioned(this))
         {
             return;
         }
         list = GlobalCache.GetParameterConfig(configKey);
         dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(list));
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
Ejemplo n.º 11
0
        protected override void LoadAssetAsync <T>(string assetPath, AssetHandler <T> handler, ErrorHandler errorhandler = null)
        {
            bool load;

            if (typeof(T) == typeof(AssetBundle))
            {
                var id = HashAssetID(assetPath);
                var ab = GlobalUtil.Binsearch(mAbs, id);
                load = LoadAB(assetPath, ab, handler, errorhandler);
            }
            else
            {
                var meta = GetOrNewMeta(assetPath);
                load = LoadAsset <T>(meta, handler, errorhandler);
            }
            if (load)
            {
                FinishAndLoadNextAsset();
            }
        }
Ejemplo n.º 12
0
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (tempItem == null)
                {
                    tempItem = curItem;
                }

                SalesPromotionCostumeSelectForm form = new SalesPromotionCostumeSelectForm(tempItem, curType, isSalesPromotionUse, filterValid);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    costumeResult = form.Result;
                    if (costumeResult.Value != null)
                    {
                        SetLabel(costumeResult.Value.Count, costumeResult.Key);
                    }
                    else
                    {
                        if (costumeResult.Key)
                        {
                            // this.skinLabelCostume.Text = "所有商品不参与促销";
                            this.skinLabelCostume.Text = "没有商品参与该促销活动,请添加";
                        }
                        else
                        {
                            this.skinLabelCostume.Text = "没有商品参与该促销活动,请添加";
                        }
                    }
                    if (tempItem == null)
                    {
                        tempItem = new SalesPromotion();
                    }
                    SetItem(tempItem);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
        }
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {//调用服务修改积分信息
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }



                int selectType = Result;

                switch (selectType)
                {
                case 0:
                    //记账
                    break;

                case 1:
                    break;

                case 2:
                    //  result = true;
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 14
0
        private static void ExecutarValidacoes()
        {
            var tipos    = TodosOsTipos;
            var servicos = tipos.Where(x => x.IsSubclassOf(typeof(DnServicoTransacionalBase))).ToList();

            ValidateIfAllServicePropertiesNotHaveTheSetMethod(servicos);
            ValidateIfAllServicePropertiesAreVirtual(servicos);
            ValidateIfAllServicePropertiesNotHavePublic(servicos);
            ValidateIfAllServicePropertiesHaveDefaultConstructor(servicos);

            ValidarEspecificacoes(tipos.Where(x => x.IsSubclassOf(typeof(DnEspecificacaoBase))).ToList());
            ValidarControladores(tipos.Where(x => x.IsSubclassOf(typeof(DnControladorBase))).ToList());

            tipos.Select(x => GlobalUtil.GetDnEntityType(x, typeof(DnServico <EntidadeBase>)))
            .Where(x => x.Item1 != null).ToList()
            .ForEach(AddService);

            tipos.Select(x => GlobalUtil.GetDnEntityTypeByInterface(x, typeof(IDnRepositorio <EntidadeBase>)))
            .Where(x => x?.Item1 != null).ToList()
            .ForEach(AddRepository);

            tipos.Select(x => GlobalUtil.GetDnEntityType(x, typeof(DnValidacao <EntidadeBase>)))
            .Where(x => x.Item1 != null).ToList()
            .ForEach(AddValidation);

            tipos.Select(x => GlobalUtil.GetDnEntityType(x, typeof(EntidadeBase)))
            .Where(x => x.Item1 != null && x.Item2 != typeof(EntidadeBase)).ToList()
            .ForEach(AddModel);

            tipos.Select(x => GlobalUtil.GetDnEntityType(x, typeof(DnControlador <EntidadeBase>)))
            .Where(x => x.Item1 != null).ToList()
            .ForEach(AddController);

            // Todo - Não me recordo o motivo de estar comentado, mas acredito que tenha que descomentar
            // ValidateIfAllMethodsAreVirtual(Services.Valores.ToList()); // To intercept
            // ValidateIfAllMethodsAreVirtual(Repositories.Valores.ToList()); // To intercept
            // ValidateIfAllMethodsAreVirtual(Validations.Valores.ToList()); //It is not necessary
            CheckErrorInTheRepository(Repositorios.Values.ToList());

            // DbSetup(createDatabaseIfNotExists);
        }
Ejemplo n.º 15
0
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(skinTextBoxID.Text))
                {
                    GlobalMessageBox.Show("名称不能为空!");
                    this.skinTextBoxID.Focus();
                    return;
                }

                if (ValidateUtil.InputOutOfLimit(skinTextBoxID.Text, "名称", 10))
                {
                    this.skinTextBoxID.Focus();
                    return;
                }
                //if (string.IsNullOrEmpty(skinTextBoxCode.Text))
                //{
                //    MessageBox.Show("编码不能为空!");
                //    this.skinTextBoxCode.Focus();
                //    return;
                //}

                if (action == OperationEnum.Add)
                {
                    Add();
                }
                else
                {
                    Save();
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 16
0
        private void baseButtonImport_Click(object sender, EventArgs e)
        {
            path = CJBasic.Helpers.FileHelper.GetFileToOpen("请选择导入文件");
            if (String.IsNullOrEmpty(path))
            {
                return;
            }


            string fileExt = Path.GetExtension(path);

            if (fileExt != ".xlsx" && fileExt != ".xls")
            {
                ShowMessage("你所选择文件格式不正确,请重新上传文件!");
                return;
            }


            if (GlobalMessageBox.Show("是否开始导入" + System.IO.Path.GetFileName(path), "友情提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                path = null;
                return;
            }

            /*  if (NPOIHelper.IsFileInUse(path))
             * {
             *    ShowMessage("你所选择文件已被打开,请关闭后再重新导入!");
             *    return;
             * }
             */
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoImport);
                cb.BeginInvoke(null, null);
            }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
        }
Ejemplo n.º 17
0
        private void Btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //ShowMessage(Pinyin.GetInitials("埼", Encoding.GetEncoding("GB2312")));

                PfCommissionPayWay payWay = new PfCommissionPayWay();
                if (skinRadioButtonSale.Checked == true)
                {
                    payWay = PfCommissionPayWay.Application;
                }
                else
                {
                    payWay = PfCommissionPayWay.Active;
                }


                InteractResult result = GlobalCache.ServerProxy.SetPfCommissionPayWay(payWay);

                if (result.ExeResult == ExeResult.Success)
                {
                    GlobalMessageBox.Show("保存成功!");
                }
                else
                {
                    GlobalMessageBox.Show(result.Msg);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 18
0
        private void BaseButtonQuery_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                List <Supplier> suppliers = GlobalCache.ServerProxy.GetSupplierList4IDOrName(this.skinTextBoxName.Text);
                dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(suppliers));
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
        private void Search()
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                //InteractResult<List<SupplierAccountRecord>> listPage = GlobalCache.ServerProxy.GetPfAccountRecord(para);
                //this.dataGridViewPagingSumCtrl.BindingDataSource(listPage.Data);
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 20
0
    public void AddData <T>() where T : UIPopupBase
    {
        if (_dataContainer.ContainsKey(typeof(T)) == false)
        {
            string className = GlobalUtil.AddString(typeof(T).ToString(), DATA);

            var typecheck = Type.GetType(className);

            if (typecheck != null)
            {
                var dataClass = Activator.CreateInstance(Type.GetType(className)) as UIData;

                _dataContainer.Add(typecheck, dataClass);
                _typeContainer.Add(typeof(T), typecheck);
            }
            else
            {
                Debug.Log("UIData is Null : " + className);
            }
        }
    }
Ejemplo n.º 21
0
        public void CheckSmsCode(string code)
        {
            GlobalUtil.ShowProgress("GetSmsCodeRsult");

            Task.Run(async() =>
            {
                var result = await Call(SITE_BASE_API + CHECK_SMS_URL, new NameValueCollection()
                {
                    { "phoneNumber", GlobalUtil.NativeUtil.LoadFromLocal("phonenumber") },
                    { "code", code }
                });
                var parsed = JObject.Parse(result);
                if (parsed["preferedMessage"].ToString().Length > 0)
                {
                    GlobalUtil.NativeUtil.ShowMessage(parsed["preferedMessage"].ToString());
                }

                new MessageBusPayload(MessageBusPayload.BroadcastEnum.GetSmsCodeRsult, (bool)parsed["result"])
                .Post();
            });
        }
Ejemplo n.º 22
0
        public T FindMovement <T>() where T : ActorMovement
        {
            FilterDelegate <ActorMovement> fiter = (x) => x is T;
            var mov = GlobalUtil.Find(mBaseMotions, fiter);

            if (mov != null)
            {
                return((T)mov);
            }
            mov = GlobalUtil.Find(mAdditiveMotions, fiter);
            if (mov != null)
            {
                return((T)mov);
            }
            mov = GlobalUtil.Find(mPassiveMotions, fiter);
            if (mov != null)
            {
                return((T)mov);
            }
            return(null);
        }
Ejemplo n.º 23
0
        public void Signup(string username, string nickname)
        {
            GlobalUtil.ShowProgress("UserSignUp");

            Task.Run(async() =>
            {
                var result = await Call(SITE_BASE_API + SIGNUP_URL, new NameValueCollection()
                {
                    { "username", username },
                    { "nickname", nickname }
                });
                var parsed = JObject.Parse(result);
                if (parsed["preferedMessage"].ToString().Length > 0)
                {
                    GlobalUtil.NativeUtil.ShowMessage(parsed["preferedMessage"].ToString());
                }

                new MessageBusPayload(MessageBusPayload.BroadcastEnum.UserSignUp, (bool)parsed["result"])
                .Post();
            });
        }
Ejemplo n.º 24
0
        public void RequestSmsCode(string phonenumber)
        {
            GlobalUtil.ShowProgress("RequestSmsCode");

            GlobalUtil.NativeUtil.SaveInLocal("phonenumber", phonenumber);
            Task.Run(async() =>
            {
                var result = await Call(SITE_BASE_API + REQUEST_SMS_URL, new NameValueCollection()
                {
                    { "phoneNumber", phonenumber }
                });
                var parsed = JObject.Parse(result);
                if (parsed["preferedMessage"].ToString().Length > 0)
                {
                    GlobalUtil.NativeUtil.ShowMessage(parsed["preferedMessage"].ToString());
                }

                new MessageBusPayload(MessageBusPayload.BroadcastEnum.RequestSmsCode, (bool)parsed["result"])
                .Post();
            });
        }
Ejemplo n.º 25
0
 /// <summary>
 /// Method Disposes the Context.
 /// </summary>
 /// <param name="disposing"></param>
 private void Dispose(bool disposing)
 {
     try
     {
         if (!_isDisposed)
         {
             if (disposing)
             {
                 if (_context != null)
                 {
                     _context.Dispose();
                 }
                 _isDisposed = true;
             }
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.HandleAndLogException(ex, this);
     }
 }
Ejemplo n.º 26
0
    private T CreatePopupUI <T>(string folder, UIPopupBase.PopupType type = UIPopupBase.PopupType.POP_UP, bool preOption = false) where T : UIPopupBase
    {
        // SpriteLoad;

        if (type == UIPopupBase.PopupType.FRONT)
        {
            if (_frontPopup)
            {
                _accFrontUI++;
                return(null);
            }
        }

        T bundlePopup = null;

        bundlePopup = GetPoolUI <T>();

        if (bundlePopup == null)
        {
            GameObject res = Resources.Load <GameObject>(GlobalUtil.AddString("Prefab/UI/Popup/", typeof(T).ToString()));

            if (res == null)
            {
                Debug.LogError("Look for Other Resources Path : " + typeof(T).ToString());
                return(null);
            }

            GameObject obj = Instantiate(res);

            bundlePopup = obj.GetComponent <T>();
        }

        selectParentBelongtoUI(bundlePopup, type, preOption);


        _datamanager.AddData <T>();


        return(bundlePopup as T);
    }
Ejemplo n.º 27
0
        private void skinComboBoxPromotionType_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                SkinComboBox box = (SkinComboBox)sender;
                //if (ruleCtrl != null) {
                //    this.ruleCtrl.Hide();
                //}
                curType = (PromotionTypeEnum)box.SelectedValue;
                switch (curType)
                {
                case PromotionTypeEnum.MJ:
                    this.ruleCtrl         = mjRuleCtrl1;
                    this.ruleCtrl.Enabled = true;
                    this.discountRuleCtrl1.Hide();
                    break;

                case PromotionTypeEnum.Discount:
                    this.ruleCtrl         = discountRuleCtrl1;
                    this.ruleCtrl.Enabled = true;
                    this.mjRuleCtrl1.Hide();
                    break;

                case PromotionTypeEnum.YKJ:
                    this.ruleCtrl.Enabled = false;
                    break;

                default:
                    this.ruleCtrl         = mjRuleCtrl1;
                    this.ruleCtrl.Enabled = true;
                    this.discountRuleCtrl1.Hide();
                    break;
                }
                this.ruleCtrl.Show();
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
        }
Ejemplo n.º 28
0
        private void UpIsCheck(int itemID, bool isSee)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = CommonGlobalCache.ServerProxy.UpdateBrandDisable(itemID, isSee);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    /*   string name = textBox1.Text.ToString();
                     * //if (name != "")
                     * //{
                     * List<Brand> getlist = GlobalCache.ServerProxy.GetBrands4IdOrName(name);
                     * foreach (Brand bItem in getlist)
                     * {
                     *     bItem.IsEnable = !bItem.IsDisable;
                     * }
                     * dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(getlist));*/
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Ejemplo n.º 29
0
 private void LoadConfig()
 {
     try
     {
         try
         {
             config = SaveCostumeFormConfiguration.Load(CONFIG_PATH) as SaveCostumeFormConfiguration;
         }
         catch (Exception ex)
         {
             GlobalUtil.WriteLog(ex);
         }
         if (config == null)
         {
             config = new SaveCostumeFormConfiguration();
         }
         else
         {
             if (config.Costume != null)
             {
                 //  skinComboBox_SupplierID.SelectedValue = config.Costume.SupplierID;
                 skinComboBox_Brand.SelectedValue = config.Costume.BrandID;
                 skinComboBox_Year.SelectedValue  = config.Costume.Year.ToString();
                 skinComboBox_Season.skinComboBox.SelectedValue = config.Costume.Season;
                 skinComboBoxBigClass.SelectedValue             = config.Costume;
                 //加载上次保存的尺码组信息
                 selectSizeGroup                   = new SizeGroupSetting();
                 selectSizeGroup.SizeGroup         = CommonGlobalCache.GetSizeGroup(config.Costume.SizeGroupName);
                 selectSizeGroup.SelectedSizeNames = config.Costume.SizeNames;
                 skinLabelSizeGroup.Text           = selectSizeGroup.SelectedDisplaySizeNames;
                 //  skinCmbProperty.SelectedValue = (CostumeProperty)config.Costume.Property;
             }
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
        void GetCopys()
        {
            m_StateCopys = new FiniteState[m_States.arraySize];
            for (int i = 0; i < m_StateCopys.Length; i++)
            {
                m_StateCopys[i] = new FiniteState();
                CopySerializedField(m_States.GetArrayElementAtIndex(i), m_StateCopys[i]);
            }
            m_TransitionCopys = new FiniteStateTransition[m_Transitions.arraySize];
            for (int i = 0; i < m_TransitionCopys.Length; i++)
            {
                m_TransitionCopys[i] = new FiniteStateTransition();
                CopySerializedField(m_Transitions.GetArrayElementAtIndex(i), m_TransitionCopys[i]);
            }

            m_TransArrows.Clear();
            HashSet <int> execlude = new HashSet <int>();

            for (int i = 0; i < m_TransitionCopys.Length; i++)
            {
                if (execlude.Contains(i))
                {
                    continue;
                }
                var arrow = new Arrow();
                var trans = m_TransitionCopys[i];
                arrow.from = GlobalUtil.FindIndex(m_StateCopys, (x) => x.m_StateName == trans.m_FromState);
                arrow.to   = GlobalUtil.FindIndex(m_StateCopys, (x) => x.m_StateName == trans.m_ToState);
                var reverse = arrow.from == -1 || arrow.to == -1 ? -1 : GlobalUtil.FindIndex(m_TransitionCopys, (x) => x.m_FromState == trans.m_ToState && x.m_ToState == trans.m_FromState);
                if (reverse != -1)
                {
                    execlude.Add(reverse);
                    arrow.twoSide = true;
                }
                m_TransArrows.Add(arrow);
            }

            Reposition();
        }