protected void cbp_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            var cbp = sender as ASPxCallbackPanel;
            if (cbp == null) return;

            var objSett = this.Get_DefineInfo();
            if (cbp.ID == this.cbpSavingMsg.ID)
            {
                var actionName = Lib.IsNOE(this.Get_CurrentSettingCode()) ? "Add new " : "Update ";
                try
                {
                    // Gọi hàm save
                    var objWgIntr = new lsttbl_WidgetInteraction()
                    {
                        WidgetCode = this.MyPage.LayoutCode,
                        JsonStr = objSett.ToJsonStr()
                    };
                    MyBI.Me.Save_WidgetInteraction(objWgIntr);
                }
                catch { this.Set_SaveMsgText(string.Format("{0} failed!", actionName), true); }
                // Gửi trạng thái về client;
                this.Set_SaveMsgText(string.Format("{0} success!", actionName), false);
            }
            else if (cbp.ID == this.cbpPreView.ID)
            {
                //this.SetPreView(objSett);
            }
        }
Example #2
0
        public void Save_WidgetInteraction(lsttbl_WidgetInteraction info)
        {
            var db = GlobalVar.DbBI;
            try
            {
                var objFound = db.lsttbl_WidgetInteractions.FirstOrDefault(p => p.WidgetCode == info.WidgetCode);
                if (objFound == null)
                    db.lsttbl_WidgetInteractions.InsertOnSubmit(info);
                else
                    objFound.UpdateOnSubmit(info);

                db.SubmitChanges();
            }
            catch { }
        }
 partial void Updatelsttbl_WidgetInteraction(lsttbl_WidgetInteraction instance);
 partial void Deletelsttbl_WidgetInteraction(lsttbl_WidgetInteraction instance);
 partial void Insertlsttbl_WidgetInteraction(lsttbl_WidgetInteraction instance);