protected void Save(object sender, EventArgs e) { //Validation Fields FormDesign oForm = new FormDesign(); Hashtable oHT = oForm.ValidateMandatoryFields(ctrFormDesign1.eFormID, TabContainer1); if (oHT != null) { Guid oguid = new Guid(); string Msg = oHT["Message"].ToString(); string oControlClientID = oHT["ClientID"].ToString(); int TabID = Convert.ToInt16(oHT["TabID"].ToString()); DesignFormTab otab = DesignFormTab.Load<DesignFormTab>(TabID); if (otab != null) { FormDesign.SetActiveIndex(TabContainer1, otab.Name, otab.SysIdentity); } ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), oguid.ToString(), "showToolTip(event,'" + Msg + "', '" + oControlClientID + "', true);", true); return; } Guid oFinalguid = new Guid(); try { FormDesign oFD = new FormDesign(); oFD.SaveTabsData(ResourceID, TabContainer1, ctrFormDesign1.DBTableName, ctrFormDesign1.eFormID, IDColumnName); DesignFormTab otab = DesignFormTab.GetDataBySysIdentity(this.ctrFormDesign1.eFormID, hidActiveTab.Value); if (otab != null) { FormDesign.SetActiveIndex(TabContainer1, otab.Name, otab.SysIdentity); } } catch (Exception ex) { string Msg = ex.Message.Replace("/", " "); Msg = Msg.Replace(" \" ", string.Empty); Msg = "We have problems to save data."; ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), oFinalguid.ToString(), "callMessageBox('eFormWarnStatus','" + Msg + "');", true); return; } ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), oFinalguid.ToString(), "callMessageBox('eFormSucessStatus','" + SaveMessage + "');", true); }
protected void IniField() { if (TabContainer1.Tabs.Count > 0) { foreach (TabPanel panel in this.TabContainer1.Tabs) { panel.Controls.Clear(); List<DesignFormField> oControlList = new List<DesignFormField>(); FormDesign oDesign = new FormDesign(); oDesign.oPage = this.Page; DesignFormTab oTab = DesignFormTab.GetDataBySysIdentity(1, panel.ID); if (oTab != null) { // oControlList = DesignFormField.GetDataBy(oTab.FormTabID, 1); // oDesign.SetPanelControl(panel, oControlList); } } this.ctrFormDesign1.CreateImageControls(this.TabContainer1); } }
protected void IniField() { List<DesignFormTab> oTabList = new List<DesignFormTab>(); if (Session["DesignFormTabList"] != null) { oTabList = Session["DesignFormTabList"] as List<DesignFormTab>; } else { oTabList = DesignFormTab.GetDataBy(Convert.ToInt32(FormID)); Session["DesignFormTabList"] = oTabList; } // First tab was default table should not remove // TabContainer1.Tabs.Clear(); // if (FormID > 0) { if (TabContainer1.Tabs.Count > 1) { // keep the first one, remove all foreach (TabPanel oTab in TabContainer1.Tabs) { if (oTab.ID.ToLower() != "tabs") { TabContainer1.Tabs.Remove(oTab); } } } foreach (DesignFormTab oTab in oTabList) { Boolean IsAlreadyLoad = false; //foreach (TabPanel oPanel in TabContainer1.Tabs) //{ // if (oTab.Name.ToUpper() == oPanel.HeaderText.ToUpper()) // { // IsAlreadyLoad = true; // break; // } // if (oPanel.HeaderText == string.Empty) // { // TabContainer1.Tabs.Remove(oPanel); // IsAlreadyLoad = false; // } //} TabPanel otab = TabContainer1.FindControl(oTab.SysIdentity) as TabPanel; if (otab == null ) { AjexTabs.AddNewTabToTabContainer(TabContainer1, oTab.Name, oTab.SysIdentity, oTab.Description, hidActiveTab.ClientID, Convert.ToBoolean(oTab.IsEnabled)); } } } if (ctrFormDesign1.ActiveTabID != string.Empty) { TabPanel oTP = TabContainer1.FindControl(ctrFormDesign1.ActiveTabID) as TabPanel; TabContainer1.ActiveTab = oTP; } //LoadeFormTabList(FormID); if (TabContainer1.Tabs.Count > 0) { foreach (TabPanel panel in this.TabContainer1.Tabs) { if ( panel.TabIndex >0 ) { panel.Controls.Clear(); List<DesignFormField> oControlList = new List<DesignFormField>(); FormDesign oDesign = new FormDesign(); oDesign.oPage = this.Page; DesignFormTab oTab = DesignFormTab.GetDataBySysIdentity(Convert.ToInt32(FormID), panel.ID); if (oTab != null) { oControlList = DesignFormField.GetDataBy(oTab.SysIdentity, Convert.ToInt32( FormID)); oDesign.SetPanelControl(panel, oControlList); } } } this.ctrFormDesign1.CreateImageControls(this.TabContainer1); } else { } }
public void SaveTabsData(Int64 IDValue, Panel oPanel, string DBTable, int eFromID, string IDColumnName) { DataTable oDt = DesignFormField.GetDataTableStructure(DBTable, IDColumnName, IDValue); DataTable oSaveDT = new DataTable(); FormDesign oDesign = new FormDesign(); oSaveDT = SetTabValueIntoDataSet(oDt, false, oPanel, "", DBTable); string sql = CreateQuerStatement(IDValue, oSaveDT, DBTable, IDColumnName); DBManager odbm = new DBManager(); odbm.ExecuteNonQuery(sql); }
public static DataTable SetTabValueIntoDataSet(DataTable oTabDataInfo, Boolean IsGeneralTable, Panel oPanel, String GeneralTable, string DBTable) { // UsersManager oUserManager = new UsersManager(); FormDesign oDesign = new FormDesign(); oDesign.SetDataToDB(oPanel, oTabDataInfo, DBTable); return oTabDataInfo; }
public static DataTable SetTabValueIntoDataSet(DataTable oTabDataInfo, Boolean IsGeneralTable, TabContainer tabContainer, String GeneralTable, string DBTable) { // UsersManager oUserManager = new UsersManager(); foreach (TabPanel panel in tabContainer.Tabs) { FormDesign oDesign = new FormDesign(); oDesign.SetDataToDB(panel, oTabDataInfo, DBTable); } return oTabDataInfo; }
public static void SetDataToControls(Panel panel, string DBTable, Int64 IDValue, string IDColumnName, int eFormID) { DataTable oDT = DesignFormField.GetDataTableStructure(DBTable, IDColumnName, IDValue); if (oDT.Rows.Count > 0) { FormDesign oDesign = new FormDesign(); SetDataToControlsOnPanel(panel, oDT, eFormID); } }
public static void SetDataToControls(TabContainer oTab, string DBTable, Int64 IDValue, string IDColumnName, int eFormID) { if (eFormID > 0 && IDValue > 0) { DataTable oDT = DesignFormField.GetDataTableStructure(DBTable, IDColumnName, IDValue); if (oDT.Rows.Count > 0) { foreach (TabPanel panel in oTab.Tabs) { FormDesign oDesign = new FormDesign(); SetDataToControls(panel, oDT, eFormID); } } } }