Beispiel #1
0
        private void LoadYear()
        {
            try
            {
                DataTable dtYear = new DataTable();
                dtYear.Columns.Add("Year", typeof(string));
                dtYear.Columns.Add("Version", typeof(string));

                DataRow dr = dtYear.NewRow();
                dtYear.Rows.Add("--Select--", "0");
                dtYear.Rows.Add("2010", "9.0");
                dtYear.Rows.Add("2011", "10.0");
                dtYear.Rows.Add("2012", "10.0");
                dtYear.Rows.Add("2013", "12.0");
                dtYear.Rows.Add("2013+", "13.0");
                cmbYear.DataSource    = dtYear;
                cmbYear.DisplayMember = "Year";
                cmbYear.ValueMember   = "Version";
                cmbYear.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                ClsCommon.WriteErrorLogs("Form:frmQBConfig,Function :LoadYear. Message:" + ex.Message);
                DisplayMessage("Error:" + ex.Message, "E");
            }
        }
Beispiel #2
0
        private void btnInv_Click(object sender, EventArgs e)
        {
            try
            {
                if (chkInvDate.Checked == true)
                {
                    Program.mySetting.InvStartDate = dtInvDate.Value.ToString("yyyy-MM-dd");
                }
                else
                {
                    Program.mySetting.InvStartDate = "";
                }



                Program.mySetting.Save();

                DisplayMessage("Invoice setting save successfully", "I");

                btnNext.Enabled = true;
            }
            catch (Exception ex)
            {
                ClsCommon.WriteErrorLogs("Form:FrmQBConfig,Function :btnInv_Click. Message:" + ex.Message);
                DisplayMessage("Error:" + ex.Message, "E");
            }
        }
Beispiel #3
0
        /// <summary>
        /// load事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmEntiUpdate_Load(object sender, EventArgs e)
        {
            this.progressBarXEntiUpdate.Visible = false;
            this.labelX1.Visible = false;


            this._mapControl = ClsControl.MapControlMain;
            IMap pMap = this._mapControl.Map;

            if (pMap == null)
            {
                return;
            }


            this._pFeatlayerList = new List <IFeatureLayer>();
            ClsCommon pClsCommon = new ClsCommon();

            this._pFeatlayerList = pClsCommon.GetFeatureLayers(pMap);
            //初始化Combox
            foreach (IFeatureLayer pFeatureLay in this._pFeatlayerList)
            {
                this.toUpdateBox.Items.Add(pFeatureLay.Name);
                this.updatedBox.Items.Add(pFeatureLay.Name);
            }
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (ClsCommon.CheckSession() == false)
     {
         Response.Redirect("~/Login.aspx");
     }
 }
        public static string GetElectricityYearlyData(string FromDate, string ToDate, int TypeId)
        {
            ClsCommon obj = new ClsCommon();
            string    Res = "";

            SqlParameter[] pars = new SqlParameter[3];

            try
            {
                pars[0]       = new SqlParameter("@FromDATE", SqlDbType.DateTime);
                pars[0].Value = obj.ConvertDate(FromDate);;
                pars[1]       = new SqlParameter("@ToDate", SqlDbType.DateTime);
                pars[1].Value = obj.ConvertDate(ToDate);
                pars[2]       = new SqlParameter("@TypeId", SqlDbType.BigInt);
                pars[2].Value = TypeId;

                Res = obj.GridFill("Electrical_Yearly_Consumption", pars);
            }
            catch (Exception ex)
            {
                ErrorHandler.ErrorsEntry(ex.GetBaseException().ToString(), "Page:LiveDashboard.aspx.cs;Method:GetElectricityYearlyData", 0);
                Res = "";
            }
            return(Res);
        }
Beispiel #6
0
        public AddFranchiesResponse BecomeNewFranchise(AddFranchies model)
        {
            Logger.InsertLogsApp("Insert Franchisee start ");

            AddFranchiesResponse objFranchies = new AddFranchiesResponse();

            try
            {
                string[] insert          = { model.Name.ToString(), model.Email.ToString(), model.Mobile.ToString(), model.PinCode.ToString(), model.Address.ToString(), model.CreatedBy.ToString() };
                string   insertFrenchies = "INSERT INTO [dbo].[FranchiesMaster]([Name],[Email],[Mobile],[PinCode],[Address],[IsActive],[CreatedDate],[CreatedBy]) VALUES (@1,@2,@3,@4,@5,1,GetDate(),@6);Select SCOPE_IDENTITY()";
                int      sourceid        = dbc.ExecuteScalarQueryWithParams(insertFrenchies, insert);
                if (sourceid > 0)
                {
                    objFranchies.response   = "1";
                    objFranchies.FranchieId = sourceid.ToString();
                    objFranchies.message    = "Thank you for registering. We will contact you very soon!";
                    ClsCommon.SendFranchiesEmail(model.Email, model.Name, model.Mobile, model.Address, model.PinCode);
                }
                else
                {
                    objFranchies.response   = "0";
                    objFranchies.FranchieId = "0";
                    objFranchies.message    = "Please Try Again!!";
                }
            }
            catch (Exception ex)
            {
                objFranchies.response   = "0";
                objFranchies.FranchieId = "0";
                objFranchies.message    = "Please Try Again!!";
            }
            return(objFranchies);
        }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CalendarExtender1.EndDate = DateTime.Now;
     if (ClsCommon.CheckSession() == false)
     {
         Response.Redirect("~/Login.aspx");
     }
     if (Convert.ToInt32(Session["UserID"].ToString()) == 1)
     {
         Panel2.Visible = true;
     }
     else
     {
         Panel2.Visible = false;
     }
     if (Session["usertype"].ToString() == "Student")
     {
         Panel4.Visible = false;
         Panel3.Visible = true;
     }
     else
     {
         Panel4.Visible = true;
     }
 }
Beispiel #8
0
        protected void BindTextBoxvalues()
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["RequestID"]))
                {
                    requestID = Request.QueryString["RequestID"].Trim();
                }

                List <CPT_ResourceDemand> lst = ResourceDemandBL.uiDataBinding(requestID);
                ClsCommon.ddlGetStatusNew(StatusMasterID, lst[0].StatusMasterID.Value);

                OpportunityID.Text = lst[0].OpportunityID.ToString();
                List <int> regionIDs = ResourceDemandBL.getRegionID(lst[0].AccountID);
                regionID = regionIDs[0];
                RegionMasterID.Items.FindByValue(regionID.ToString()).Selected = true;
                List <int> CityIDs = ResourceDemandBL.CityIDs(regionID);
                ClsCommon.ddlGetAccountWithCity(AccountMasterID, CityIDs);
                AccountMasterID.Text    = lst[0].AccountID.ToString();
                SalesStageMasterID.Text = lst[0].SalesStageID.ToString();
                processName.Text        = lst[0].ProcessName;
                StatusMasterID.Text     = lst[0].StatusMasterID.ToString();

                ViewState["dateOfCreation"] = lst[0].DateOfCreation.ToString();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 确定(输入完成之后)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EntityCodeBtn_Click(object sender, EventArgs e)
        {
            string selectEntityID = this.EntityCode.Text;

            if (selectEntityID == "")
            {
                MessageBox.Show("查询的地理实体不存在!");
                return;
            }
            string source = this._entityDictionary[selectEntityID];

            IMap pMap = this._mapControl.Map;

            if (pMap == null)
            {
                return;
            }

            _pFeatlayerList = new List <IFeatureLayer>();
            ClsCommon pClsCommon = new ClsCommon();

            _pFeatlayerList = pClsCommon.GetFeatureLayers(pMap);

            this._graphElements.Clear();

            foreach (IFeatureLayer pFeatureLay in _pFeatlayerList)
            {
                string sourceType = ClsConfig.LayerConfigs[(pFeatureLay.FeatureClass as IDataset).Name].SourceType;
                if (source.Contains(sourceType))
                {
                    this.GetGraphElementsInLyr(selectEntityID, _pFeatlayerList, (pFeatureLay.FeatureClass as IDataset).Name);
                }
            }
            this.InitialTrackBar();
        }
        private void BindUserDetails()
        {
            var objUser = UserRepository.UserDetails(Convert.ToInt32(Request.QueryString["Id"]));

            if (objUser != null)
            {
                txtName.Text    = objUser.UserName;
                txtEmailId.Text = objUser.EmailId;
                txtLoginId.Text = Convert.ToString(objUser.LoginId);
                txtPwd.Attributes.Add("value", objUser.LoginPwd);
                ddlStatus.SelectedValue = objUser.Status.ToString();
                if (objUser.TypeId == 1)
                {
                    ClsCommon.FillLoginTypeAdmin(ddUserLevel);
                    ddUserLevel.Enabled = false;
                    ddlStatus.Enabled   = false;
                }
                else
                {
                    ClsCommon.FillLoginType(ddUserLevel);
                }
                ClsCommon.FillSelect(ddUserLevel);
                ddUserLevel.SelectedValue = objUser.TypeId.ToString();
            }
        }
Beispiel #11
0
        /// <summary>
        /// Lock(Testing)
        /// </summary>
        /// <param name="account"></param>
        /// <param name="simespan"></param>
        /// <returns></returns>
        public static ResponseModel <string> LockMIT(string account, Int32 simespan)
        {
            var result = new ResponseModel <string>()
            {
                IsSuccess = false
            };

            try
            {
                List <Object> lstPars = new List <object>();
                lstPars.Add(account);
                lstPars.Add(simespan);
                var sendT    = m_Contract_Geth.GetFunction(Consts.M_ContractFunctions.M_Lock);
                var tranCode = sendT.SendTransactionAsync(ClsNethereum.M_DefultAccount, new HexBigInteger(1000000), new HexBigInteger(Web3.Convert.ToWei(0, Nethereum.Util.UnitConversion.EthUnit.Ether)), lstPars.ToArray()).Result;

                result.IsSuccess = true;
                result.Data      = tranCode;
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
                ClsCommon.WriteLog(ex.ToString(), Consts.M_LogType.M_Error);
            }
            return(result);
        }
Beispiel #12
0
        /// <summary>
        /// unlock account
        /// </summary>
        /// <returns></returns>
        public static ResponseModel <bool> unLockAccount(string strPassword)
        {
            var resultM = new ResponseModel <bool>()
            {
                IsSuccess = false
            };

            try
            {
                var accounts     = M_Web3_Geth.Eth.Accounts.SendRequestAsync().Result;
                var unLockResult = M_Web3_Geth.Personal.UnlockAccount.SendRequestAsync(ClsNethereum.M_DefultAccount, strPassword, 1000 * 60 * 10).Result;
                if (unLockResult)
                {
                    resultM.IsSuccess = true;
                    resultM.Data      = true;
                }
                else
                {
                    resultM.Message = "The password is incorrect. Please try again.";
                }
            }
            catch (Exception ex)
            {
                resultM.Message = ex.Message;
                ClsCommon.WriteLog(ex.ToString(), Consts.M_LogType.M_Error);
            }

            return(resultM);
        }
Beispiel #13
0
 private void btnVerify_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckValidation())
         {
             string  Connection = "server=" + txtDatabaseHost.Text.Trim() + ";user="******";Persist Security Info=True;database=" + txtDatabaseName.Text.Trim() + ";port=3306;password="******";";
             Boolean IsVerify   = clsDBOperation.VerifyConnection_Info(Connection);
             if (IsVerify)
             {
                 Program.mySetting.HostName     = txtDatabaseHost.Text.Trim();
                 Program.mySetting.DatabaseName = txtDatabaseName.Text.Trim();
                 Program.mySetting.UserName     = txtUserName.Text.Trim();
                 Program.mySetting.Password     = txtPassword.Text.Trim();
                 Program.mySetting.Connection   = Connection;
                 Program.mySetting.Save();
                 DisplayMessage("Database Connection Saved Successfully", "I");
                 btnNext.Enabled = true;
             }
             else
             {
                 DisplayMessage("Database Connection not Done.", "I");
             }
         }
     }
     catch (Exception ex)
     {
         ClsCommon.WriteErrorLogs("Form:FrmMySqlConfig,Function :btnClose_Click. Message:" + ex.Message);
         DisplayMessage("Error:" + ex.Message, "E");
     }
 }
Beispiel #14
0
        private void LoadLogSettings(object sender, EventArgs e)
        {
            ClsCommon common = new ClsCommon();

            if (common.Read("ENABLELOGGING") == "TRUE")
            {
                chkEnableLogging.CheckState = CheckState.Checked;
            }
            else
            {
                chkEnableLogging.CheckState = CheckState.Unchecked;
            }

            if (common.Read("VIEWLOGFILESONEXIT") == "TRUE")
            {
                chkViewLogFilesonExit.CheckState = CheckState.Checked;
            }
            else
            {
                chkViewLogFilesonExit.CheckState = CheckState.Unchecked;
            }

            txtLogFileSaveLocation.Text = common.Read("LOGFILESAVELOCATION");

            btnRefresh_Click(sender, e);
        }
Beispiel #15
0
 private void CreateAccount(object sender, FrmPassword.GetPasswordEventArgs e)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(e.M_Password))
         {
             if (ClsNethereum.createNewAccount(e.M_Password))
             {
                 DisplayFromAccount();
             }
             else
             {
                 string     strMessage = @"The registration process is failed.It may be caused in unstable network environment.Please try again later. For repeated issue, please contact ";
                 FrmMessage msg        = new FrmMessage(M_MessageType.Error
                                                        , strMessage
                                                        , true);
                 msg.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         ClsCommon.WriteLog(ex.ToString(), Consts.M_LogType.M_Error);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ClsCommon.CheckSession() == false)
        {
            Response.Redirect("~/Login.aspx");
        }
        if (Convert.ToInt32(Session["UserID"].ToString()) == 1)
        {
            Panel1.Visible = true;
        }
        else
        {
            Panel1.Visible = false;
        }

        /*TextBox1.Text = "";
         * TextBox2.Text = "";
         * TextBox3.Text = "";
         * TextBox4.Text = "";
         * TextBox5.Text = "";
         * TextBox6.Text = "";
         * TextBox7.Text = "";
         * TextBox8.Text = "";
         * TextBox9.Text = "";
         * TextBox10.Text = "";
         * TextBox11.Text = "";
         * TextBox12.Text = "";
         * TextBox13.Text = "";*/
    }
Beispiel #17
0
        public JsonResult GetProductAttributes(string category)
        {
            List <GbMAttributes>     listGbMAttributes = null;
            List <FSCFoodAttributes> objFoodAttributes = new List <FSCFoodAttributes>();

            try
            {
                int categoryId = 0;
                listGbMAttributes = new List <GbMAttributes>();
                try
                {
                    Int32.TryParse(category, out categoryId);
                }
                catch (Exception exc)
                {
                    categoryId = 0;
                }
                listGbMAttributes = new ClsCommon().GetFoodAttributes(0, categoryId, "");
                if (listGbMAttributes != null && listGbMAttributes.Count > 0)
                {
                    var grpAttributes = listGbMAttributes.GroupBy(n => new { n.AttributeGroupCode, n.AttributeGroupDesc })
                                        .Select(g => new
                    {
                        g.Key.AttributeGroupCode,
                        g.Key.AttributeGroupDesc
                    }).ToList();
                    foreach (var attr in grpAttributes)
                    {
                        FSCFoodAttributes fscAttribute = new FSCFoodAttributes();
                        fscAttribute.AttributeGroupCode = attr.AttributeGroupCode;
                        fscAttribute.AttributeGroupDesc = attr.AttributeGroupDesc;
                        List <FSCFoodAttributeValues> attributeValuesList = new List <FSCFoodAttributeValues>();
                        foreach (var att in listGbMAttributes)
                        {
                            if (att.AttributeGroupCode == attr.AttributeGroupCode)
                            {
                                FSCFoodAttributeValues attValue = new FSCFoodAttributeValues();
                                attValue.AttributeId        = att.AttributeId;
                                attValue.AttributeValue     = att.AttributeValue;
                                attValue.AttributeGroupCode = att.AttributeGroupCode;
                                attValue.AttributeGroupDesc = att.AttributeGroupDesc;
                                attributeValuesList.Add(attValue);
                            }
                        }
                        fscAttribute.FoodAttributes = attributeValuesList;
                        objFoodAttributes.Add(fscAttribute);
                    }
                }
                return(Json(objFoodAttributes));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                listGbMAttributes = null;
            }
        }
Beispiel #18
0
 public static int AddAsmProductionByObjectReturnId(AsmProductionObject apo)
 {
     using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
     {
         var result = conn.Insert(apo);
         return(Convert.ToInt32(result));
     }
 }
Beispiel #19
0
 public static int AddBoltByObject(BoltObject bo)
 {
     using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
     {
         var result = conn.Insert(bo);
         return(Convert.ToInt32(result));
     }
 }
 /// <summary>
 /// 增加BOM信息
 /// </summary>
 /// <param name="pbo"></param>
 /// <returns></returns>
 public static int AddRecipeDetail(AsmRecipeDetailObject ardo)
 {
     using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
     {
         var result = conn.Insert(ardo);
         return(Convert.ToInt32(result));
     }
 }
Beispiel #21
0
 public static int AddAsmRTrackingByObject(AsmRTrackingObject arto)
 {
     using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
     {
         var result = conn.Insert(arto);
         return(Convert.ToInt32(result));
     }
 }
Beispiel #22
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     ClsCommon.InitialiseClasses();
     ClsCommon.InitialisePages();
     Application.Run(new frmMainUI());
 }
        //public void Email()
        //{
        //    try
        //    {
        //        List<CPT_ResourceMaster> lstdetils = new List<CPT_ResourceMaster>();
        //        lstdetils = (List<CPT_ResourceMaster>)Session["UserDetails"];
        //        string employeeEmailID = lstdetils[0].Email;

        //        CPT_EmailTemplate registrationEmail = new CPT_EmailTemplate();
        //        registrationEmail.Name = "ResourceDemand";
        //        registrationEmail.To = new List<string>();
        //        registrationEmail.To.Add(employeeEmailID);
        //        registrationEmail.ToUserName = new List<string>();
        //        registrationEmail.ToUserName.Add(lstdetils[0].EmployeetName);
        //        //registrationEmail.UID = lstdetils[0].EmployeeMasterID.ToString();
        //        TokenMessageTemplate valEmail = new TokenMessageTemplate();
        //        valEmail.SendEmail(registrationEmail);
        //    }
        //    catch (Exception ex)
        //    {

        //        Console.WriteLine(ex.Message);
        //    }

        //}

        private void SetPreviousDataforRemove()
        {
            try
            {
                int rowIndex = 0;
                if (ViewState["CurrentTable"] != null)
                {
                    DataTable dt = (DataTable)ViewState["CurrentTable"];
                    if (dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            DropDownList ddl  = (DropDownList)GridviewResourceDetail.Rows[rowIndex].Cells[1].FindControl("ResourceTypeID");
                            TextBox      box2 = (TextBox)GridviewResourceDetail.Rows[rowIndex].Cells[2].FindControl("NoOfResources");
                            DropDownList ddl1 = (DropDownList)GridviewResourceDetail.Rows[rowIndex].Cells[3].FindControl("ddlPrimary");
                            DropDownList ddl2 = (DropDownList)GridviewResourceDetail.Rows[rowIndex].Cells[4].FindControl("ddlSecondry");
                            DropDownList ddl3 = (DropDownList)GridviewResourceDetail.Rows[rowIndex].Cells[5].FindControl("ddlTernary");
                            TextBox      box3 = (TextBox)GridviewResourceDetail.Rows[rowIndex].Cells[6].FindControl("StartDate");
                            TextBox      box4 = (TextBox)GridviewResourceDetail.Rows[rowIndex].Cells[7].FindControl("EndDate");

                            //box3.Attributes["min"] = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
                            //box4.Attributes["min"] = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");


                            //Fill the DropDownList with Data
                            ClsCommon.ddlGetRoleforDemand(ddl);
                            // ClsCommon.ddlGetSkillDDL(ddl1);
                            ClsCommon.ddlGetSkillddl(ddl1, "Select Primary Skill");
                            ClsCommon.ddlGetSkillddl(ddl2, "Select Secondry Skill");
                            ClsCommon.ddlGetSkillddl(ddl3, "Select Ternary Skill");


                            ddl.ClearSelection();

                            ddl.Items.FindByValue(dt.Rows[i]["ResourceTypeID"].ToString()).Selected = true;
                            box2.Text = dt.Rows[i]["NoOfResources"].ToString().Trim();

                            ddl1.ClearSelection();
                            ddl2.ClearSelection();
                            ddl3.ClearSelection();
                            ddl1.Items.FindByValue(dt.Rows[i]["PrimarySkill"].ToString()).Selected  = true;
                            ddl2.Items.FindByValue(dt.Rows[i]["SecondrySkill"].ToString()).Selected = true;
                            ddl3.Items.FindByValue(dt.Rows[i]["TernarySkill"].ToString()).Selected  = true;

                            box3.Text = dt.Rows[i]["StartDate"].ToString().Trim();
                            box4.Text = dt.Rows[i]["EndDate"].ToString().Trim();

                            rowIndex++;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            //int rowIndex = 0;
        }
Beispiel #24
0
        private void PopulateSourceDatabase()
        {
            ClsCommon common = new ClsCommon();

            lstSource.DisplayMember = "TableName";
            lstSource.DataSource    = common.GetTablesfromDbDetails(sourceServer, sourceUsername, sourcePassword, sourceDatabase).Tables[0];

            //Dispose(true);
        }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     ClsCommon.WriteLog("Application Closed.");
     if (disposing && (components != null))
     {
         components.Dispose();
     }
     base.Dispose(disposing);
 }
Beispiel #26
0
        private void btnSConnect_Click(object sender, EventArgs e)
        {
            //Date: 27th October 2012
            //By: Kshitij [[email protected]]
            //Connects to the Database based on the Server, Username and Password.
            //Grows the List of the Databases found on the credentials provided.
            //-----------------------------------------------------------------------------------------------------------------------------
            try
            {
                ClsCommon common  = new ClsCommon();
                string    message = string.Empty;

                //Validations
                //Checks the blank input and provides the message based on the Label Text, like, if Server is Empty,
                //it provides the message by pointing the Label Text ['Server'].
                //For more: Check the Method ValidateInput in Common class
                //----------------------------------------------------------------------------------------------------
                message = message + common.ValidateInput(txtSServer.Text, label1.Text, ValidationType.EmptyCheck);
                message = message + common.ValidateInput(txtSUsername.Text, label2.Text, ValidationType.EmptyCheck);
                message = message + common.ValidateInput(txtSPassword.Text, label3.Text, ValidationType.EmptyCheck);

                if (message.Length > 1)
                {
                    MessageBox.Show("Following information is mandatory to provide:\n\n\n" + message, "Information", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    message = string.Empty;
                }
                else
                {
                    //Authenticates the user
                    //Gets the Databases based on the Credentials provided and grows the list.
                    //-----------------------------------------------------------------------------------------------
                    if (common.IsUserAuthenticated(txtSServer.Text, txtSUsername.Text, txtSPassword.Text))
                    {
                        //Fills the Combobox with the permitted database list
                        //======================================================================================
                        cmbSDatabase.Enabled       = true;
                        cmbSDatabase.DataSource    = common.GetDatabases().Tables[0];
                        cmbSDatabase.DisplayMember = "name";
                        cmbSDatabase.ValueMember   = "name";
                        cmbSDatabase.SelectedIndex = 0;
                        //======================================================================================
                        //btnProceed.Enabled = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Credentials provided.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                string error = "Cannot Proceed or not functional due to the following Exception: \n\n" + ex.Message + "\n\nFor further information please contact to vendor or visit www.krayknot.com";
                MessageBox.Show(error, "LooDon: Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridView1.DataBind();
     if (ClsCommon.CheckSession() == false)
     {
         //Response.Redirect("~/Login.aspx");
     }
     Label1.Visible = false;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack == false)
     {
         ClsCommon.ddlGetDesignation(listDesignation);
         ClsCommon.ddlGetAccount(accountDropDownList);
         ClsCommon.ddlGetSkillDDL(skillListDD);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                CountryNameTextBox.Enabled = false;

                ClsCommon.ddlGetRegion(RegionList);
                BindGrid();
            }
        }
Beispiel #30
0
        public static int UpdateProductionRecipeByObject(AsmProductionRecipeObject apro)
        {
            var result = 0;

            using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
            {
                result = conn.Update(apro);
            }
            return(Convert.ToInt32(result));
        }