protected void Page_Load(object sender, EventArgs e)
        {
            ToolkitScriptManager1.RegisterAsyncPostBackControl(bShow);
            tbStart.Attributes.Add("readonly", "readonly");
            tbEnd.Attributes.Add("readonly", "readonly");
            DA = new SqlDataAdapter();
            DS = new DataSet();
            DA.SelectCommand            = new SqlCommand();
            DA.SelectCommand.Connection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=CWM;Persist Security Info=True;User ID=CWM;Password=manager");

            if (!Page.IsPostBack)
            {
                CalendarExtender1.SelectedDate = DateTime.Today;
                CalendarExtender2.SelectedDate = DateTime.Today;
                tbStart.Text = DateTime.Today.ToString("dd.MM.yyyy");
                tbEnd.Text   = DateTime.Today.ToString("dd.MM.yyyy");
                DA.SelectCommand.CommandText = "select ID,ASNAME from CWM..ADDITIONALSERVICE";
                DS = new DataSet();
                DA.Fill(DS, "ADDSERV");
                chblEmp.DataSource     = DS.Tables["ADDSERV"];
                chblEmp.DataTextField  = "ASNAME";
                chblEmp.DataValueField = "ID";
                chblEmp.DataBind();
                chblEmp.RepeatColumns = 3;
            }
            else
            {
                DateTime tmp;
                //if ((!DateTime.TryParse(tbStart.Text, out tmp)) || (!DateTime.TryParse(tbEnd.Text, out tmp)))
                {
                    CalendarExtender1.SelectedDate = DateTime.ParseExact(tbStart.Text, CalendarExtender1.Format, null);
                    CalendarExtender2.SelectedDate = DateTime.ParseExact(tbEnd.Text, CalendarExtender2.Format, null);
                }
            }
        }
Exemple #2
0
        protected void txtUserId_TextChanged(object sender, EventArgs e)
        {
            lblMessage.Visible = false;
            try
            {
                if (string.IsNullOrEmpty(txtUserId.Text))
                {
                    return;
                }
                var clientId = ConfigurationReader <string> .GetAppConfigurationValue(Constants.ClientIdConfKey);

                if (!ValidateUser(clientId, txtUserId.Text.ToString(CultureInfo.InvariantCulture)))
                {
                    lblMessage.InnerHtml = GlobalCustomResource.Default_txtUserId_TextChanged_Invalid_Userid__;
                    lblMessage.Visible   = true;
                }
                else
                {
                    if (ddlFinancialYear.Items.Count > 1)
                    {
                        ddlFinancialYear.SelectedIndex = 1;
                    }
                    ToolkitScriptManager1.SetFocus(txtPassword);
                }
            }
            catch (Exception ex)
            {
                lblMessage.InnerHtml = GlobalCustomResource.Default_lnkLogin_Click_Login_Failed_Error;
                AuditLog.LogEvent(SysEventType.ERROR, "Login Authentication", "Login failed with exception", ex);
                lblMessage.Visible = true;
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            // Global Information Display
            Title = ConfigurationReader <string> .GetAppConfigurationValue(Constants.AppVersionConfKey);

            lblCopyRightYear.Text =
                ConfigurationReader <string> .GetAppConfigurationValue(Constants.AppCopyRightConfKey);

            ToolkitScriptManager1.SetFocus(txtUserId);
        }
Exemple #4
0
 protected void imgbtnDF_Init(object sender, EventArgs e)
 {
     ToolkitScriptManager1.RegisterPostBackControl((Control)sender);
 }
Exemple #5
0
 public void RegisterPostbackTrigger(Control triggerControl)
 {
     ToolkitScriptManager1.RegisterPostBackControl(triggerControl);
 }
Exemple #6
0
 public void SetFocus(Control txtbx)
 {
     ToolkitScriptManager1.SetFocus(txtbx);
 }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bAdd.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(bAdd, null) + ";");
            tbCar.Attributes["onclick"] = "chbManual.Checeked = !chbManual.Checeked";
            ToolkitScriptManager1.RegisterAsyncPostBackControl(bAdd);
            DA = new SqlDataAdapter();
            DS = new DataSet();
            DA.SelectCommand            = new SqlCommand();
            DA.SelectCommand.Connection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=CWM;Persist Security Info=True;User ID=CWM;Password=manager");
            if (!Page.IsPostBack)
            {
                DA.SelectCommand.CommandText = "select ID,LNAME from CWM..LINE";
                DA.Fill(DS, "L");
                ddlLine.DataSource     = DS.Tables["L"];
                ddlLine.DataTextField  = "LNAME";
                ddlLine.DataValueField = "ID";
                ddlLine.DataBind();

                DA.SelectCommand.CommandText = "select ID,ENAME from CWM..EMPLOYEE where (DELETED != 1 or DELETED is null) order by ENAME";
                DA.Fill(DS, "E");
                DataView dve = new DataView();
                dve      = DS.Tables["E"].DefaultView;
                dve.Sort = "ENAME";

                ddlCar.DataSource           = dve;
                ddlEmployees.DataSource     = dve;
                ddlEmployees.DataTextField  = "ENAME";
                ddlEmployees.DataValueField = "ID";
                ddlEmployees.DataBind();
                DA.SelectCommand.CommandText = "select ID,CNAME+': '+ANNOTATION as CNAME from CWM..CARCLASS";
                DS = new DataSet();
                DA.Fill(DS, "C");
                ddlClass.DataSource     = DS.Tables["C"];
                ddlClass.DataTextField  = "CNAME";
                ddlClass.DataValueField = "ID";
                ddlClass.DataBind();
                DA.SelectCommand.CommandText = "select ID,CNAME from CWM..CAR where IDCLASS = " + ddlClass.SelectedValue + "  order by CNAME";
                DS = new DataSet();
                DA.Fill(DS, "CAR");
                DataView dv = new DataView();
                dv      = DS.Tables["CAR"].DefaultView;
                dv.Sort = "CNAME";

                ddlCar.DataSource     = dv;
                ddlCar.DataTextField  = "CNAME";
                ddlCar.DataValueField = "ID";

                ddlCar.DataBind();

                /*DA.SelectCommand.CommandText = "select ID,PNAME from CWM..PRICELIST where IDCLASS = " + ddlClass.SelectedValue
                 + " order by PNAME";
                 + DS = new DataSet();
                 + DA.Fill(DS, "PRICE");
                 + chblPrice.DataSource = DS.Tables["PRICE"];
                 + chblPrice.DataTextField = "PNAME";
                 + chblPrice.DataValueField = "ID";
                 + chblPrice.DataBind();
                 + chblPrice.RepeatColumns = 2;*/

                /*DA.SelectCommand.CommandText = "select ID,ASNAME from CWM..ADDITIONALSERVICE order by ASNAME";
                 * DS = new DataSet();
                 * DA.Fill(DS, "ADDITIONALSERVICE");
                 * chblAddServ.DataSource = DS.Tables["ADDITIONALSERVICE"];
                 * chblAddServ.DataTextField = "ASNAME";
                 * chblAddServ.DataValueField = "ID";
                 * chblAddServ.DataBind();
                 * chblAddServ.RepeatColumns = 2;*/
            }
        }