コード例 #1
0
ファイル: CanonResellerGroup.cs プロジェクト: ddksaku/canon
        public static void InsertOrUpdateResellerGroup(CanonResellerGroup newValue)
        {
            CanonDataContext db = Cdb.Instance;
            ResellerGroup rg = null;

            if (newValue.ID == -1)
            {
                rg = new ResellerGroup();
                db.ResellerGroups.InsertOnSubmit(rg);
            }
            else
            {
                rg = db.ResellerGroups.FirstOrDefault(r => r.ID == newValue.ID);
            }

            rg.FileAs = newValue.FileAs;
            rg.Code = newValue.Code;

            db.SubmitChanges();
        }
コード例 #2
0
        public static void InsertOrUpdateResellerGroup(CanonResellerGroup newValue)
        {
            CanonDataContext db = Cdb.Instance;
            ResellerGroup    rg = null;

            if (newValue.ID == -1)
            {
                rg = new ResellerGroup();
                db.ResellerGroups.InsertOnSubmit(rg);
            }
            else
            {
                rg = db.ResellerGroups.FirstOrDefault(r => r.ID == newValue.ID);
            }

            rg.FileAs = newValue.FileAs;
            rg.Code   = newValue.Code;

            db.SubmitChanges();
        }
コード例 #3
0
ファイル: AdminGroups.ascx.cs プロジェクト: ddksaku/canon
        protected void gridResellerGroups_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            try
            {
                SessionManager.IsEditFormCreated = false;

                CanonResellerGroup crg = new CanonResellerGroup();
                crg.ID = int.Parse(e.Keys[0].ToString());
                crg.FileAs = e.NewValues["FileAs"].ToString();
                crg.Code = e.NewValues["Code"].ToString();
                CanonResellerGroup.InsertOrUpdateResellerGroup(crg);

                e.Cancel = true;
                this.gridResellerGroups.CancelEdit();
                this.BindData();
            }
            catch (Exception ex)
            {
                Logger.Log(string.Format("exception {0}", ex.ToString()), LogLevel.Error);
            }
        }