Exemplo n.º 1
0
    protected void grid_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "OK")
        {
            ASPxComboBox   cmb_JobType    = ASPxPopupControl1.FindControl("cmb_JobType") as ASPxComboBox;
            ASPxButtonEdit txt_CustomerId = ASPxPopupControl1.FindControl("txt_CustomerId") as ASPxButtonEdit;
            ASPxDateEdit   issueDate      = ASPxPopupControl1.FindControl("date_IssueDate") as ASPxDateEdit;
            if (txt_CustomerId.Text.Trim() == "" && txt_CustomerName.Text.Trim() == "")
            {
                e.Result = "Fail! Please enter the Customer";
                return;
            }
            if (cmb_JobType.Text.Trim() == "")
            {
                e.Result = "Fail! Please enter the JobType";
                return;
            }
            else
            {
                e.Result = SaveNewJob();
            }
        }
    }
Exemplo n.º 2
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox     txtLuongCB     = grid.FindEditFormTemplateControl("txtLuongCB") as ASPxTextBox;
            ASPxDateEdit    txtThoiDiem    = grid.FindEditFormTemplateControl("txtThoiDiem") as ASPxDateEdit;
            ASPxHiddenField HiddentfileKem = grid.FindEditFormTemplateControl("HiddentfileKem") as ASPxHiddenField;
            ASPxTextBox     txtfilekem     = grid.FindEditFormTemplateControl("txtfilekem") as ASPxTextBox;
            ASPxTextBox     txtQuyetDinh   = grid.FindEditFormTemplateControl("txtQuyetDinh") as ASPxTextBox;

            this.luongcb = objBaoHiem.GetLuongCBId(Int32.Parse(e.Keys[grid.KeyFieldName].ToString()));
            if (this.luongcb != null)
            {
                this.luongcb.luongcb  = Convert.ToDecimal(txtLuongCB.Text.Trim());
                this.luongcb.thoidiem = txtThoiDiem.Date;
                this.luongcb.soqd     = txtQuyetDinh.Text.Trim();
                if (HiddentfileKem.Count > 0)
                {
                    this.luongcb.fileKem = "LCB" + DateTime.Now.ToShortDateString().Replace("/", "_") + "_" + HiddentfileKem.Get("filekem").ToString();
                }
                else
                {
                    this.luongcb.fileKem = "LCB" + DateTime.Now.ToShortDateString().Replace("/", "_") + "_" + txtfilekem.Text.Trim();
                }
                this.objBaoHiem.UpdateLuongCB(luongcb);
            }
            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objBaoHiem.GetLuongCBs();
            this.grid.DataBind();
        }
Exemplo n.º 3
0
        //新增
        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxComboBox ljdm       = ASPxGridView1.FindEditFormTemplateControl("comboLJDM") as ASPxComboBox;
            ASPxDateEdit begindate1 = ASPxGridView1.FindEditFormTemplateControl("dateStart") as ASPxDateEdit;
            ASPxDateEdit enddate1   = ASPxGridView1.FindEditFormTemplateControl("dateEnd") as ASPxDateEdit;

            string    ljmc = "";
            string    sqlC = "select PT_DESC2 from COPY_PT_MSTR where pt_part='" + ljdm.Value.ToString() + "'";
            DataTable dt   = dc.GetTable(sqlC);

            if (dt.Rows.Count > 0)
            {
                ljmc = dt.Rows[0]["PT_DESC2"].ToString();
            }


            string Sql = "INSERT INTO ATPUBOMKZB (ABOM_COMP,ZDRQ,RQBEGIN,RQEND,LJMC) "
                         + " VALUES ( '" + ljdm.Value.ToString() + "',sysdate,to_date('" + begindate1.Text.Trim() + "','yyyy-MM-dd'),to_date('" + enddate1.Text.Trim() + "','yyyy-MM-dd'),'" + ljmc + "')";

            dc.ExeSql(Sql);

            //记录操作start
            string logSql = "insert into atpubomkzb_log(abom_comp,zdrq,rqbegin,rqend,rqsj,yhmc,czms)"
                            + " select abom_comp,zdrq,rqbegin,rqend,sysdate,'" + theUserName + "','增加了新的零件' "
                            + " from  atpubomkzb where abom_comp='" + ljdm.Value.ToString() + "'";

            dc.ExeSql(logSql);
            //记录操作end

            e.Cancel = true;
            ASPxGridView1.CancelEdit();
            setCondition1();
        }
    protected void Date_Validation(object sender, ValidationEventArgs e)
    {
        DateTime     date1        = (DateTime)e.Value;
        ASPxDateEdit de           = sender as ASPxDateEdit;
        int          visibleIndex = ((GridViewDataItemTemplateContainer)de.NamingContainer).VisibleIndex;

        if (de.ID.Contains("HireDate"))
        {
            DateTime birthDate = CheckDateEdit("BirthDate", visibleIndex);
            if (birthDate != DateTime.MinValue)
            {
                CheckYears(e, date1, birthDate);
            }
            else
            {
                e.IsValid = false;
            }
        }
        else
        {
            DateTime hireDate = CheckDateEdit("HireDate", visibleIndex);
            if (hireDate != DateTime.MinValue)
            {
                CheckYears(e, hireDate, date1);
            }
            else
            {
                e.IsValid = false;
            }
        }
    }
Exemplo n.º 5
0
    private decimal Get_Incentive(string name)
    {
        ASPxDateEdit txt_FromDate = ASPxGridView1.FindEditFormTemplateControl("txt_FromDate") as ASPxDateEdit;
        ASPxDateEdit txt_ToDate   = ASPxGridView1.FindEditFormTemplateControl("txt_ToDate") as ASPxDateEdit;
        string       dateFrom     = txt_FromDate.Date.ToString("yyyy-MM-dd");
        string       dateTo       = txt_ToDate.Date.ToString("yyyy-MM-dd");
        string       sql          = string.Format(@"with pri as (select * from ctm_MastData where [Type]='tripcode'),tb1 as (
select det2.JobNo,det2.ContainerNo,
(select isnull(sum(isnull(Qty*Price,0)),0) from job_cost where TripNo=det2.Id and LineType='DP' and ChgCode='Trip') as Incentive1,
(select isnull(sum(isnull(Qty*Price,0)),0) from job_cost where TripNo=det2.Id and LineType='DP' and ChgCode='OverTime') as Incentive2,
(select isnull(sum(isnull(Qty*Price,0)),0) from job_cost where TripNo=det2.Id and LineType='DP' and ChgCode='Standby') as Incentive3,
(select isnull(sum(isnull(Qty*Price,0)),0) from job_cost where TripNo=det2.Id and LineType='DP' and ChgCode='PSA') as Incentive4
from CTM_JobDet2 as det2
left outer join CTM_JobDet1 as det1 on det2.Det1Id=det1.Id
left outer join CTM_Job as job on job.jobNo=det2.JobNo
left outer join CTM_Driver as dri on dri.Code=det2.DriverCode ");
        string       sql_part1    = string.Format(@")
select *,isnull(Incentive1,0)+isnull(Incentive2,0)+isnull(Incentive3,0)+isnull(Incentive4,0) as TotalIncentive from tb1");

        string where = string.Format(@" where det2.Statuscode='C' and DATEDIFF(d,det2.ToDate,'{0}')<=0 and DATEDIFF(d,det2.ToDate,'{1}')>=0", dateFrom, dateTo);
        where       += string.Format(@" and det2.DriverCode='{0}'", name);
        DataTable dt_incentive = ConnectSql.GetTab(sql + where + sql_part1);
        decimal   amt          = 0;

        for (int j = 0; j < dt_incentive.Rows.Count; j++)
        {
            amt += SafeValue.SafeDecimal(dt_incentive.Rows[0]["TotalIncentive"]);
        }
        return(amt);
    }
Exemplo n.º 6
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  txtQuyetDinh      = gridKhenThuong.FindEditFormTemplateControl("txtQuyetDinh") as ASPxTextBox;
            ASPxDateEdit dateNgayQuyetDinh = gridKhenThuong.FindEditFormTemplateControl("dateNgayQuyetDinh") as ASPxDateEdit;
            ASPxTextBox  txtNguoiKy        = gridKhenThuong.FindEditFormTemplateControl("txtNguoiKy") as ASPxTextBox;
            ASPxTextBox  txtGhiChu         = gridKhenThuong.FindEditFormTemplateControl("txtGhiChu") as ASPxTextBox;
            ASPxComboBox cmbNamThiDua      = gridKhenThuong.FindEditFormTemplateControl("cmbNamThiDua") as ASPxComboBox;
            ASPxComboBox cmbThanhTich      = gridKhenThuong.FindEditFormTemplateControl("cmbThanhTich") as ASPxComboBox;
            ASPxComboBox cmbDanhHieuThiDua = gridKhenThuong.FindEditFormTemplateControl("cmbDanhHieuThiDua") as ASPxComboBox;
            ASPxComboBox cmb_capkhenthuong = gridKhenThuong.FindEditFormTemplateControl("cmb_capkhenthuong") as ASPxComboBox;
            string       fileqd            = "";

            if (Session["fileKhenThuong"] != null)
            {
                fileqd = Session["fileKhenThuong"].ToString();
            }

            int n = SqlHelper.ExecuteNonQuery(strconn, "[HRM_KhenThuong_UI]", Int32.Parse(e.Keys[gridKhenThuong.KeyFieldName].ToString()), 14, 0, 1,
                                              txtGhiChu.Text, txtQuyetDinh.Text, dateNgayQuyetDinh.Date.ToString("dd/MM/yyyy"), "", 0, fileqd,
                                              Int32.Parse(cmbDanhHieuThiDua.Value.ToString()), 0, Convert.ToInt32(cmbNamThiDua.Value.ToString()),
                                              txtNguoiKy.Text, 0, 0, cmb_capkhenthuong.Value, 1);

            gridKhenThuong.CancelEdit();
            e.Cancel = true;

            LoadDanhHieuThiDuaKhenThuong(Int32.Parse(cmbNam.Value.ToString()), 0);
        }
        protected void grdApproval_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView grid       = sender as ASPxGridView;
            ASPxDateEdit effectDate = grdApproval.FindEditRowCellTemplateControl((GridViewDataColumn)grdApproval.Columns["EffectDate"], "EffectDate") as ASPxDateEdit;
            ASPxTextBox  Remarks    = grdApproval.FindEditRowCellTemplateControl((GridViewDataColumn)grdApproval.Columns["Remarks"], "ASPxRemarksTextBox") as ASPxTextBox;

            string sLastModified = DateTime.Now.ToString();
            string PK            = e.Keys[0].ToString();

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();

            string update_MRP = "UPDATE tbl_System_Approval " +
                                " SET [EffectDate] = @EffectDate, " +
                                " [Remarks]= @Remarks, " +
                                " [LastModified] = @LastModified " +
                                " WHERE [PK] = @PK";

            SqlCommand cmd = new SqlCommand(update_MRP, conn);

            cmd.Parameters.AddWithValue("@PK", PK);
            cmd.Parameters.AddWithValue("@EffectDate", effectDate.Value.ToString());
            cmd.Parameters.AddWithValue("@Remarks", Remarks.Value.ToString());
            cmd.Parameters.AddWithValue("@LastModified", sLastModified);
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();

            conn.Close();

            BindApproval();
            e.Cancel = true;
            grid.CancelEdit();
        }
Exemplo n.º 8
0
        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            if (txtPCode.Text.Trim() == "")
            {
                return;
            }
            else
            {
                ASPxTextBox uPSo = ASPxGridView1.FindEditFormTemplateControl("txtPSo") as ASPxTextBox;
                //ASPxComboBox uPCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
                ASPxTextBox  uPNum         = ASPxGridView1.FindEditFormTemplateControl("txtPNum") as ASPxTextBox;
                ASPxComboBox uPlanCode     = ASPxGridView1.FindEditFormTemplateControl("txtPlanCode") as ASPxComboBox;
                ASPxComboBox uOnLocation   = ASPxGridView1.FindEditFormTemplateControl("txtOnLocation") as ASPxComboBox;
                ASPxDateEdit uOnlinetime   = ASPxGridView1.FindEditFormTemplateControl("DateOnlinetime") as ASPxDateEdit;
                string       strPSo        = uPSo.Text.Trim();
                string       strPCode      = txtPCode.Value.ToString();
                string       strPNum       = uPNum.Text.Trim();
                string       strPlanCode   = uPlanCode.Value.ToString();
                string       strOnLocation = uOnLocation.Value.ToString();
                string       strOnlinetime = uOnlinetime.Text.Trim();

                string Sql = "INSERT INTO MS_SINGLE_PLAN(PLAN_CODE,PLAN_SO,PLAN_NUM,ONLINE_LOCATION,ONLINE_TIME,FLAG,ADD_TIME,GZDD)"
                             + "VALUES('" + strPlanCode + "','" + strPSo + "','" + strPNum + "','" + strOnLocation + "',to_date('" + uOnlinetime.Value + "','yyyy-mm-dd hh24:mi:ss'),'N',sysdate,'" + strPCode + "')";
                dc.ExeSql(Sql);

                e.Cancel = true;
                ASPxGridView1.CancelEdit();
                setCondition();
            }
        }
Exemplo n.º 9
0
    protected void txt_search_dateFrom_Init(object sender, EventArgs e)
    {
        ASPxDateEdit date = sender as ASPxDateEdit;
        GridViewDataItemTemplateContainer container = date.NamingContainer as GridViewDataItemTemplateContainer;

        date.Value = DateTime.Today;
    }
Exemplo n.º 10
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox  txtTitle         = grid.FindEditFormTemplateControl("txtTitle") as ASPxTextBox;
            ASPxTextBox  txtCoefficient   = grid.FindEditFormTemplateControl("txtCoefficient") as ASPxTextBox;
            ASPxTextBox  textId           = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox;
            ASPxDateEdit txtDateEffectted = grid.FindEditFormTemplateControl("txtDateEffectted") as ASPxDateEdit;
            ASPxComboBox cboPositionGroup = grid.FindEditFormTemplateControl("cboPositionGroup") as ASPxComboBox;

            this.salary.id    = -1;
            this.salary.title = txtTitle.Text;
            if (hiddenIDBacLuong.Value != null)
            {
                this.salary.parentid = Convert.ToInt32(hiddenIDBacLuong.Value);
                this.salary.level    = objSalary.GetSalaryType(Convert.ToInt32(hiddenIDBacLuong.Value)).level.Trim();
            }
            this.salary.coefficient   = txtCoefficient.Text;
            this.salary.code          = "";
            this.salary.dateeffectted = txtDateEffectted.Date;
            this.objSalary.AddSalaryType(salary);
            grid.CancelEdit();
            e.Cancel = true;
            if (hiddenIDBacLuong.Value != null)
            {
                this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(hiddenIDBacLuong.Value), Convert.ToDateTime("01/01/1900"), 0);
                this.grid.DataBind();
            }
            else
            {
                if (Session["id"] != null)
                {
                    this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(Session["id"].ToString()), Convert.ToDateTime("01/01/1900"), 0);
                    this.grid.DataBind();
                }
            }
        }
Exemplo n.º 11
0
    protected override void AssignControllerValues()
    {
        ASPxTextBox  tbSubject      = (ASPxTextBox)FindControlByID("tbSubject");
        ASPxTextBox  tbLocation     = (ASPxTextBox)FindControlByID("tbLocation");
        ASPxTextBox  tbPrice        = (ASPxTextBox)FindControlByID("tbPrice");
        ASPxDateEdit edtStartDate   = (ASPxDateEdit)FindControlByID("edtStartDate");
        ASPxDateEdit edtEndDate     = (ASPxDateEdit)FindControlByID("edtEndDate");
        ASPxMemo     memDescription = (ASPxMemo)FindControlByID("memDescription");
        ASPxMemo     memContacts    = (ASPxMemo)FindControlByID("memContacts");
        ASPxComboBox cbResource     = (ASPxComboBox)FindControlByID("edtResource");


        Controller.Subject     = tbSubject.Text;
        Controller.Location    = tbLocation.Text;
        Controller.Description = memDescription.Text;

        Controller.Start = edtStartDate.Date;
        Controller.End   = edtEndDate.Date;
        // custom fields
        Controller.ContactInfo = memContacts.Text;
        Controller.Price       = Convert.ToDouble(tbPrice.Text);
        if (cbResource.SelectedItem != null)
        {
            Controller.ResourceId = cbResource.SelectedItem.Value;
        }

        DateTime clientStart = FromClientTime(Controller.Start);

        AssignControllerRecurrenceValues(clientStart);
    }
Exemplo n.º 12
0
        protected void gridKhoaDaoTao_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox  txt_madaotao = gridKhoaDaoTao.FindEditFormTemplateControl("txt_madaotao") as ASPxTextBox;
            ASPxDateEdit date_tungay  = gridKhoaDaoTao.FindEditFormTemplateControl("date_tungay") as ASPxDateEdit;
            ASPxDateEdit date_denngay = gridKhoaDaoTao.FindEditFormTemplateControl("date_denngay") as ASPxDateEdit;
            ASPxMemo     memo_noidung = gridKhoaDaoTao.FindEditFormTemplateControl("memo_noidung") as ASPxMemo;
            ASPxMemo     memo_ghichu  = gridKhoaDaoTao.FindEditFormTemplateControl("memo_ghichu") as ASPxMemo;
            ASPxListBox  lbChoosen    = gridKhoaDaoTao.FindEditFormTemplateControl("lbChoosen") as ASPxListBox;

            string filename = string.Empty;

            if (Session["file"] != null)
            {
                filename = Session["file"].ToString();
                Session.Remove("file");
            }

            object idkhoadaotao = SqlHelper.ExecuteScalar(strconn, "[HRM_ANTOANVESINHLAODONG_UI]", 0, txt_madaotao.Text, date_tungay.Value, date_denngay.Value,
                                                          memo_noidung.Text, filename, memo_ghichu.Text, 0);

            foreach (ListEditItem item in lbChoosen.SelectedItems)
            {
                SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_KETQUA_UI]", 0, idkhoadaotao, item.Value, null, 0, null, 0);
            }
            gridKhoaDaoTao.CancelEdit();
            e.Cancel = true;
            load_data_grid();
        }
Exemplo n.º 13
0
    // 主表修改
    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        //ASPxLabel billId = ASPxGridView1.FindEditFormTemplateControl("LabBillId") as ASPxLabel;
        ASPxTextBox assetcode = ASPxGridView1.FindEditFormTemplateControl("txtAssetCode") as ASPxTextBox;
        ASPxTextBox srlno     = ASPxGridView1.FindEditFormTemplateControl("txtSrlNo") as ASPxTextBox;

        ASPxGridLookup lkpVendor     = ASPxGridView1.FindEditFormTemplateControl("GridLookupVendor") as ASPxGridLookup;
        ASPxGridLookup lkpManuf      = ASPxGridView1.FindEditFormTemplateControl("GridLookupManuf") as ASPxGridLookup;
        ASPxGridLookup lkpDept       = ASPxGridView1.FindEditFormTemplateControl("GridLookupDept") as ASPxGridLookup;
        ASPxDateEdit   dtePurchDate  = ASPxGridView1.FindEditFormTemplateControl("CalPCDate") as ASPxDateEdit;
        ASPxTextBox    txtPurchCost  = ASPxGridView1.FindEditFormTemplateControl("txtPrice") as ASPxTextBox;
        ASPxDateEdit   wrtStartDate  = ASPxGridView1.FindEditFormTemplateControl("CalWRTStartDate") as ASPxDateEdit;
        ASPxDateEdit   wrtEndDate    = ASPxGridView1.FindEditFormTemplateControl("CalWRTEndDate") as ASPxDateEdit;
        ASPxTextBox    txtAssetColor = ASPxGridView1.FindEditFormTemplateControl("txtColor") as ASPxTextBox;
        ASPxTextBox    txtBarCode    = ASPxGridView1.FindEditFormTemplateControl("txtBarCode") as ASPxTextBox;
        ASPxGridLookup lkpRspPerson  = ASPxGridView1.FindEditFormTemplateControl("lkpResponsePerson") as ASPxGridLookup;
        ASPxCheckBox   chkActiveFlag = ASPxGridView1.FindEditFormTemplateControl("chkActiveFlag") as ASPxCheckBox;
        ASPxMemo       assetRemark   = ASPxGridView1.FindEditFormTemplateControl("txtRemark") as ASPxMemo;


        string deptCode = "", vendorCode = "", manufCode = "", rspPerson = "";



        ASPxGridLookup gridLookupVendor = ASPxGridView1.FindEditFormTemplateControl("GridLookupVendor") as ASPxGridLookup;
        ASPxTextBox    txtSVendor       = ASPxGridView1.FindEditFormTemplateControl("txtSVendor") as ASPxTextBox;

        if (lkpDept.Value != null)
        {
            deptCode = lkpDept.Value.ToString();
        }
        if (lkpManuf.Value != null)
        {
            manufCode = lkpManuf.Value.ToString();
        }
        if (lkpVendor.Value != null)
        {
            vendorCode = lkpVendor.Value.ToString();
        }
        if (lkpRspPerson.Value != null)
        {
            rspPerson = lkpRspPerson.Value.ToString();
        }
        string activeflag = chkActiveFlag.Checked ? "Y":"N";


        string upSql = "UPDATE data_asset_detail SET vendor_code='" + vendorCode + "',manufacturer_code='" + lkpManuf.Value + "'," +
                       "response_dept_code='" + deptCode + "',purchase_date=to_date('" + dtePurchDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss'),purchase_cost=" + txtPurchCost.Text + "," +
                       "warranty_start_date=to_date('" + wrtStartDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss'),warranty_end_date=to_date('" + wrtEndDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss')," +
                       "response_person_code='" + lkpRspPerson.Value.ToString() + "',asset_color='" + txtAssetColor.Text + "',asset_remark='" + assetRemark.Text + "',active_flag='" + activeflag + "' " +
                       " WHERE  COMPANY_CODE = '" + theCompanyCode + "' AND serial_number='" + srlno.Text + "'";

        theDc.ExeSql(upSql);



        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        queryFunction();
    }
Exemplo n.º 14
0
    private void contCfsStatusChange(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex, string CfsStatus)
    {
        if (rowIndex < 0)
        {
            e.Result = "Save Error";
            return;
        }

        ASPxLabel    lb_id = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_Id") as ASPxLabel;
        ASPxDateEdit txt_search_dateFrom = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_search_dateFrom") as ASPxDateEdit;

        ASPxTextBox date_ScheduleStartTime = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartTime") as ASPxTextBox;
        string      res = "Save Error";

        if (lb_id != null)
        {
            string sql0 = "";
            string sql  = string.Format(@"update CTM_JobDet2 set BookingDate=@BookingDate
where Id=@Oid", sql0);
            List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>();
            list.Add(new ConnectSql_mb.cmdParameters("@Oid", lb_id.Text, SqlDbType.Int));
            list.Add(new ConnectSql_mb.cmdParameters("@BookingDate", txt_search_dateFrom.Date.ToString("yyyy-MM-dd"), SqlDbType.DateTime));
            if (ConnectSql_mb.ExecuteNonQuery(sql, list).status)
            {
                res = "Save successful!";
                //C2.CtmJobDet1.contWarehouseStatusChanged(SafeValue.SafeInt(lb_id.Text, 0));
            }
        }
        e.Result = res;
    }
Exemplo n.º 15
0

        
Exemplo n.º 16
0
    protected void grid_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        if (this.grid.EditingRowVisibleIndex > -1)
        {
            ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;

            ASPxTextBox  partyName = pageControl.FindControl("txt_PartyName") as ASPxTextBox;
            ASPxTextBox  whName    = pageControl.FindControl("txt_WhName") as ASPxTextBox;
            ASPxDateEdit txt_Date  = pageControl.FindControl("txt_Date") as ASPxDateEdit;
            txt_Date.Enabled = false;
            partyName.Text   = EzshipHelper.GetPartyName(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "PartyId" }));
            whName.Text      = EzshipHelper.GetWarehouse(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "WhCode" }));
            string oid = SafeValue.SafeString(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "Id" }));
            if (oid.Length > 0)
            {
                string     sql            = string.Format("select StatusCode from wh_Contract  where Id='{0}'", oid);
                string     closeInd       = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "USE");//
                ASPxButton btn            = this.grid.FindEditFormTemplateControl("btn_CloseJob") as ASPxButton;
                ASPxButton btn_VoidMaster = this.grid.FindEditFormTemplateControl("btn_Void") as ASPxButton;
                if (closeInd == "CLS")
                {
                    btn.Text = "Open Job";
                }
                if (closeInd == "CNL")
                {
                    btn_VoidMaster.Text = "Unvoid";
                }
                else
                {
                    btn.Text = "Close";
                }
            }
        }
    }
Exemplo n.º 17
0
        protected void gridKhoaDaoTao_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  txt_madaotao = gridKhoaDaoTao.FindEditFormTemplateControl("txt_madaotao") as ASPxTextBox;
            ASPxDateEdit date_tungay  = gridKhoaDaoTao.FindEditFormTemplateControl("date_tungay") as ASPxDateEdit;
            ASPxDateEdit date_denngay = gridKhoaDaoTao.FindEditFormTemplateControl("date_denngay") as ASPxDateEdit;
            ASPxMemo     memo_noidung = gridKhoaDaoTao.FindEditFormTemplateControl("memo_noidung") as ASPxMemo;
            ASPxMemo     memo_ghichu  = gridKhoaDaoTao.FindEditFormTemplateControl("memo_ghichu") as ASPxMemo;
            ASPxListBox  lbChoosen    = gridKhoaDaoTao.FindEditFormTemplateControl("lbChoosen") as ASPxListBox;

            string filename = string.Empty;

            if (Session["file"] != null)
            {
                filename = Session["file"].ToString();
                Session.Remove("file");
                string url  = String.Format("{0}/images/FileQD/{1}", DotNetNuke.Common.Globals.ApplicationPath, gridKhoaDaoTao.GetRowValues(gridKhoaDaoTao.FocusedRowIndex, "quyetdinh"));
                string file = Server.MapPath(url);
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }

            object idkhoadaotao = SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_UI]", e.Keys["id"], txt_madaotao.Text, date_tungay.Value, date_denngay.Value,
                                                            memo_noidung.Text, filename, memo_ghichu.Text, 1);

            foreach (ListEditItem item in lbChoosen.SelectedItems)
            {
                SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_KETQUA_UI]", 0, e.Keys["id"], item.Value, null, 0, null, 0);
            }

            gridKhoaDaoTao.CancelEdit();
            e.Cancel = true;
            load_data_grid();
        }
Exemplo n.º 18
0
        //修改
        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            if (txtPCode.Text.Trim() == "")
            {
                return;
            }
            else
            {
                ASPxTextBox uPSo = ASPxGridView1.FindEditFormTemplateControl("txtPSo") as ASPxTextBox;
                //ASPxComboBox uPCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
                ASPxTextBox  uPNum         = ASPxGridView1.FindEditFormTemplateControl("txtPNum") as ASPxTextBox;
                ASPxComboBox uPlanCode     = ASPxGridView1.FindEditFormTemplateControl("txtPlanCode") as ASPxComboBox;
                ASPxComboBox uOnLocation   = ASPxGridView1.FindEditFormTemplateControl("txtOnLocation") as ASPxComboBox;
                ASPxDateEdit uOnlinetime   = ASPxGridView1.FindEditFormTemplateControl("DateOnlinetime") as ASPxDateEdit;
                string       strPSo        = uPSo.Text.Trim();
                string       strPCode      = txtPCode.Value.ToString();
                string       strPNum       = uPNum.Text.Trim();
                string       strPlanCode   = uPlanCode.Value.ToString();
                string       strOnLocation = uOnLocation.Value.ToString();
                string       strOnlinetime = uOnlinetime.Text.Trim();
                string       Sql           = "update ms_single_plan set PLAN_NUM='" + strPNum + "',online_location='" + strOnLocation + "',online_time=to_date('" + uOnlinetime.Value + "','yyyy-mm-dd hh24:mi:ss')"
                                             + "where PLAN_CODE='" + strPlanCode + "' and FLAG='N' and gzdd='" + strPCode + "'";

                dc.ExeSql(Sql);

                e.Cancel = true;
                ASPxGridView1.CancelEdit();
                setCondition();
            }
        }
Exemplo n.º 19
0
    private void OnLoad(string t)
    {
        int start = 0;     // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize;
        int end   = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize;

        for (int i = start; i < end; i++)
        {
            ASPxCheckBox isPay = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns[0], "ack_IsPay") as ASPxCheckBox;
            //ASPxButtonEdit driver = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_Transport.Columns["Driver"], "btn_DriverCode") as ASPxButtonEdit;
            ASPxComboBox driver = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "btn_DriverCode") as ASPxComboBox;
            //ASPxButtonEdit towhead = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_Transport.Columns["VehicleNo"], "btn_vehicle") as ASPxButtonEdit;
            ASPxTextBox  Id              = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "lb_Id") as ASPxTextBox;
            ASPxTextBox  lb_progress     = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "lb_progress") as ASPxTextBox;
            ASPxComboBox cbb_JobProgress = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["JobProgress"], "cbb_JobProgress") as ASPxComboBox;
            //ASPxTextEdit txt_DeliveryIndex = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_Transport.Columns["DeliveryIndex"], "txt_DeliveryIndex") as ASPxTextEdit;
            ASPxTextBox  txt_TptTime  = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["TptTime"], "txt_TptTime") as ASPxTextBox;
            ASPxDateEdit date_TptDate = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["TptDate"], "date_TptDate") as ASPxDateEdit;

            if (Id != null && driver != null & lb_progress != null && isPay != null && isPay.Checked)
            {
                Record r = new Record(Id.Text, SafeValue.SafeString(driver.Value), lb_progress.Text, 0);
                r.TptTime      = SafeValue.SafeString(txt_TptTime.Text, "00:00");
                r.TptDate      = SafeValue.SafeDate(date_TptDate.Date, new DateTime(1900, 1, 1)).ToString("yyyyMMdd");
                r.progress_new = SafeValue.SafeString(cbb_JobProgress.Value);
                list.Add(r);
            }
            else
            {
                if (Id == null)
                {
                    break;
                }
            }
        }
    }
    private void OnLoad()
    {
        int start = 0;
        int end   = 200;

        for (int i = start; i < end; i++)
        {
            ASPxCheckBox isPay    = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox;
            ASPxTextBox  partyId  = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["PartyId"], "txt_PartyId") as ASPxTextBox;
            ASPxTextBox  sku      = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Product"], "txt_Product") as ASPxTextBox;
            ASPxTextBox  des      = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Description"], "txt_Description") as ASPxTextBox;
            ASPxSpinEdit price1   = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Price1"], "spin_Price1") as ASPxSpinEdit;
            ASPxDateEdit fromDate = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["FromDate"], "txt_FromDate") as ASPxDateEdit;

            if (partyId != null && sku != null && des != null && price1 != null && fromDate != null && isPay != null && isPay.Checked)
            {
                list.Add(new Record(partyId.Text, sku.Text, des.Text, SafeValue.SafeDecimal(price1.Value, 0), fromDate.Date
                                    ));
            }
            else if (sku == null)
            {
                break;
            }
            ;
        }
    }
Exemplo n.º 21
0
 protected void grd_Do_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e)
 {
     if (this.grd_Do.EditingRowVisibleIndex > -1)
     {
         ASPxPageControl pageControl = this.grd_Do.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
         //ASPxTextBox partyName = grd_Do.FindEditFormTemplateControl("txt_PartyName") as ASPxTextBox;
         ASPxTextBox txt_DoNo = this.grd_Do.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox;
         //partyName.Text = EzshipHelper.GetPartyName(this.grd_Do.GetRowValues(this.grd_Do.EditingRowVisibleIndex, new string[] { "PartyId" }));
         string oid = SafeValue.SafeString(this.grd_Do.GetRowValues(this.grd_Do.EditingRowVisibleIndex, new string[] { "Id" }));
         if (oid.Length > 0)
         {
             ASPxDateEdit txt_Date = this.grd_Do.FindEditFormTemplateControl("txt_Date") as ASPxDateEdit;
             txt_Date.BackColor = ((DevExpress.Web.ASPxEditors.ASPxTextBox)(this.grd_Do.FindEditFormTemplateControl("txt_DoNo"))).BackColor;
             txt_Date.ReadOnly  = true;
             string     sql      = string.Format("select DoStatus from wh_Trans where Id='{0}'", oid);
             string     closeInd = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "USE");//
             ASPxButton btn      = this.grd_Do.FindEditFormTemplateControl("btn_CloseJob") as ASPxButton;
             //ASPxButton btn_Void = this.grd_Do.FindEditFormTemplateControl("btn_Void") as ASPxButton;
             if (closeInd == "Closed")
             {
                 btn.Text = "Open Job";
             }
             //if (closeInd == "CNL")
             // {
             //     btn_Void.Text = "Unvoid";
             // }
         }
     }
 }
Exemplo n.º 22
0
    private void OnLoad()
    {
        int start = 0;    // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize;
        int end   = 1000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize;

        for (int i = start; i < end; i++)
        {
            ASPxCheckBox isPay            = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "ack_IsPay") as ASPxCheckBox;
            ASPxLabel    Id               = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "lbl_Id") as ASPxLabel;
            ASPxDateEdit date_ShipDate    = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipDate"], "date_ShipDate") as ASPxDateEdit;
            ASPxTextBox  txt_ShipIndex    = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipIndex"], "txt_ShipIndex") as ASPxTextBox;
            ASPxTextBox  txt_ShipPortCode = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipPortCode"], "txt_ShipPortCode") as ASPxTextBox;
            ASPxComboBox cbb_ContIndex    = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContIndex"], "cbb_ContIndex") as ASPxComboBox;
            ASPxSpinEdit spin_Qty         = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["QtyOrig"], "spin_Qty") as ASPxSpinEdit;
            ASPxSpinEdit spin_Weight      = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["WeightOrig"], "spin_Weight") as ASPxSpinEdit;
            ASPxSpinEdit spin_Volume      = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["VolumeOrig"], "spin_Volume") as ASPxSpinEdit;

            if (Id != null && isPay != null && isPay.Checked)
            {
                list.Add(new Record(SafeValue.SafeInt(Id.Text, 0), SafeValue.SafeInt(txt_ShipIndex.Value, 0), date_ShipDate.Date, txt_ShipPortCode.Text, SafeValue.SafeString(cbb_ContIndex.Value), SafeValue.SafeDecimal(spin_Qty.Value), SafeValue.SafeDecimal(spin_Weight.Value), SafeValue.SafeDecimal(spin_Volume.Value)));
            }
            else
            {
                if (Id == null)
                {
                    break;
                }
            }
        }
    }
Exemplo n.º 23
0
        public List<WebControl> RenderControl(System.Xml.XmlNode xmlControl)
        {
            base.Initialize(xmlControl);

            ASPxDateEdit aspxDateEdit = new ASPxDateEdit
            {
                ID = _PropertyMapper.GetID(),
                NullText = "Ingrese Fecha",
                MinDate =  _PropertyMapper.GetMinDate(),
                MaxDate = _PropertyMapper.GetMaxDate(),
            };

            aspxDateEdit.ValidationSettings.SetFocusOnError = true;
            aspxDateEdit.ValidationSettings.RequiredField.IsRequired = _PropertyMapper.Required();
            aspxDateEdit.ValidationSettings.RequiredField.ErrorText = "Campo Requerido";
            aspxDateEdit.ValidationSettings.ValidationGroup = "InputValidation";

             try
             {
                 if (xmlControl.GetAttribute("CCONTROLASOC") != null)
                 {
                     aspxDateEdit.ValidationSettings.CausesValidation = true;
                     aspxDateEdit.ErrorText = "Error de Rango - Fecha Inicial debe ser menor a Fecha Final";
                     aspxDateEdit.ClientSideEvents.Validation = "function(s,e){e.isValid = CheckDifference(" + _PropertyMapper.GetID() + ", " + xmlControl.GetAttribute("CCONTROLASOC") + "); }";
                 }
             }
             catch (Exception)
            {
            }

                _Controls.Add(aspxDateEdit);

            return _Controls;
        }
Exemplo n.º 24
0
    protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string paras = e.Parameters;

        string[] ar = paras.Split('_');

        if (ar.Length >= 2)
        {
            if (ar[0].Equals("Saveline"))
            {
                #region
                ASPxGridView grid = sender as ASPxGridView;

                int          rowIndex               = SafeValue.SafeInt(ar[1], -1);
                ASPxLabel    lbl_Id                 = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_Id") as ASPxLabel;
                ASPxLabel    lbl_JobNo              = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel;
                ASPxComboBox txt_ContNo             = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContainer") as ASPxComboBox;
                ASPxLabel    lbl_ContIndex          = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_ContIndex") as ASPxLabel;
                ASPxDateEdit date_ScheduleDate      = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleDate") as ASPxDateEdit;
                ASPxTextBox  txt_SealNo             = this.grid.FindRowCellTemplateControl(rowIndex, null, "txt_SealNo") as ASPxTextBox;
                ASPxComboBox cbbContType            = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContType") as ASPxComboBox;
                ASPxDateEdit date_CustomsClearDate  = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsClearDate") as ASPxDateEdit;
                ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox;
                ASPxComboBox cmb_CustomsVerifyInd   = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox;
                ASPxDateEdit date_CustomsVerifyDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsVerifyDate") as ASPxDateEdit;
                ASPxMemo     memo_CustomsRemark     = this.grid.FindRowCellTemplateControl(rowIndex, null, "memo_CustomsRemark") as ASPxMemo;
                ASPxDateEdit date_ValiDate          = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ValiDate") as ASPxDateEdit;
                ASPxDateEdit date_ScheduleStartDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartDate") as ASPxDateEdit;
                ASPxDateEdit date_BillingDate       = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_BillingDate") as ASPxDateEdit;
                ASPxDateEdit date_DispatchDate      = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_DispatchDate") as ASPxDateEdit;
                ASPxDateEdit date_EtaDate           = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_EtaDate") as ASPxDateEdit;
                e.Result = update_cont(SafeValue.SafeInt(lbl_Id.Text, 0), lbl_JobNo.Text, txt_ContNo.Text, txt_SealNo.Text, cbbContType.Text, date_ScheduleDate.Date,
                                       lbl_ContIndex.Text, cmb_CustomsClearStatus.Text, date_CustomsClearDate.Date, cmb_CustomsVerifyInd.Text, date_CustomsVerifyDate.Date, memo_CustomsRemark.Text,
                                       date_ValiDate.Date, date_ScheduleStartDate.Date, date_BillingDate.Date, date_DispatchDate.Date, date_EtaDate.Date);
                #endregion
            }
            if (ar[0].Equals("Ediline"))
            {
                #region
                ASPxGridView grid = sender as ASPxGridView;

                int          rowIndex  = SafeValue.SafeInt(ar[1], -1);
                ASPxLabel    lbl_JobId = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobId") as ASPxLabel;
                ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox;
                ASPxComboBox cmb_CustomsVerifyInd   = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox;
                if (SafeValue.SafeString(cmb_CustomsClearStatus.Value) == "Y")
                {
                    e.Result = C2.Edi_Freight.DoOne(lbl_JobId.Text);
                    DateTime now    = DateTime.Now;
                    string   userId = HttpContext.Current.User.Identity.Name;
                    Session["Export_" + now.ToString("yyyyMMdd") + userId] = null;
                }
                else
                {
                    e.Result = "Edi Error! Pls confirm the Customs Clear Status";
                }
                #endregion
            }
        }
    }
Exemplo n.º 25
0

        
Exemplo n.º 26
0
    public void InstantiateIn(Control container)
    {
        ASPxLabel lbl = new ASPxLabel();

        lbl.ID   = "lblFrom";
        lbl.Text = "From:";
        container.Controls.Add(lbl);

        ASPxDateEdit dateFrom = new ASPxDateEdit();

        dateFrom.ID = "dateFrom";
        dateFrom.ClientInstanceName = "dFrom";
        dateFrom.Date = new DateTime(1950, 1, 1);
        container.Controls.Add(dateFrom);

        lbl      = new ASPxLabel();
        lbl.ID   = "lblTo";
        lbl.Text = "To:";
        container.Controls.Add(lbl);

        ASPxDateEdit dateTo = new ASPxDateEdit();

        dateTo.ID = "dateTo";
        dateTo.ClientInstanceName = "dTo";
        dateTo.Date = new DateTime(1960, 11, 30);
        container.Controls.Add(dateTo);

        ASPxButton btn = new ASPxButton();

        btn.ID                     = "btnApply";
        btn.Text                   = "Apply";
        btn.AutoPostBack           = false;
        btn.ClientSideEvents.Click = "function (s, e) { ApplyFilter( dFrom, dTo ); }";
        container.Controls.Add(btn);
    }
Exemplo n.º 27
0
        //修改
        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxComboBox uPCode    = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
            ASPxTextBox  uMCode    = ASPxGridView1.FindEditFormTemplateControl("txtMCode") as ASPxTextBox;
            ASPxTextBox  uMName    = ASPxGridView1.FindEditFormTemplateControl("txtMName") as ASPxTextBox;
            ASPxTextBox  uGCode    = ASPxGridView1.FindEditFormTemplateControl("txtGCode") as ASPxTextBox;
            ASPxTextBox  uGName    = ASPxGridView1.FindEditFormTemplateControl("txtGName") as ASPxTextBox;
            ASPxComboBox uQSite    = ASPxGridView1.FindEditFormTemplateControl("txtQSite") as ASPxComboBox;
            ASPxTextBox  uMNum     = ASPxGridView1.FindEditFormTemplateControl("txtMNum") as ASPxTextBox;
            ASPxDateEdit uOnTime   = ASPxGridView1.FindEditFormTemplateControl("txtOnTime") as ASPxDateEdit;
            ASPxComboBox uLocation = ASPxGridView1.FindEditFormTemplateControl("txtLocation") as ASPxComboBox;

            string strPCode     = uPCode.Value.ToString();
            string strQSite     = uQSite.Value.ToString();
            string strMCode     = uMCode.Text.Trim();
            string strMName     = uMName.Text.Trim();
            string strGName     = uGName.Text.Trim();
            string strGCode     = uGCode.Text.Trim();
            string strMNum      = uMNum.Text.Trim();
            string locationCode = uLocation.Text.Trim();

            string Sql = "update ms_single_mat_inner set material_num='" + strMNum + "',online_time=to_date('" + uOnTime.Value + "','yyyy-mm-dd hh24:mi:ss') "
                         + " where material_code='" + strMCode + "' and gzdd='" + strPCode + "' and gys_code='" + strGCode + "' and online_location='" + locationCode + "' and qadsite='" + strQSite + "' and flag='N'";

            dc.ExeSql(Sql);

            e.Cancel = true;
            ASPxGridView1.CancelEdit();
            setCondition();
        }
Exemplo n.º 28
0
        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxComboBox uPCode    = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
            ASPxTextBox  uMCode    = ASPxGridView1.FindEditFormTemplateControl("txtMCode") as ASPxTextBox;
            ASPxTextBox  uMName    = ASPxGridView1.FindEditFormTemplateControl("txtMName") as ASPxTextBox;
            ASPxTextBox  uGCode    = ASPxGridView1.FindEditFormTemplateControl("txtGCode") as ASPxTextBox;
            ASPxTextBox  uGName    = ASPxGridView1.FindEditFormTemplateControl("txtGName") as ASPxTextBox;
            ASPxComboBox uLocation = ASPxGridView1.FindEditFormTemplateControl("txtLocation") as ASPxComboBox;
            ASPxComboBox uQSite    = ASPxGridView1.FindEditFormTemplateControl("txtQSite") as ASPxComboBox;
            ASPxTextBox  uMNum     = ASPxGridView1.FindEditFormTemplateControl("txtMNum") as ASPxTextBox;
            ASPxDateEdit uOnTime   = ASPxGridView1.FindEditFormTemplateControl("txtOnTime") as ASPxDateEdit;

            string strPCode     = uPCode.Value.ToString();
            string strQSite     = uQSite.Value.ToString();
            string strMCode     = uMCode.Text.Trim();
            string strMName     = uMName.Text.Trim();
            string strGName     = uGName.Text.Trim();
            string strGCode     = uGCode.Text.Trim();
            string strMNum      = uMNum.Text.Trim();
            string locationCode = uLocation.Text.Trim();

            string Sql = "insert into ms_single_mat_inner(material_code,material_num,online_time,online_location,add_time,flag,gzdd,gys_code,qadsite)"
                         + "VALUES('" + strMCode + "','" + strMNum + "',to_date('" + uOnTime.Value + "','yyyy-mm-dd hh24:mi:ss'),'" + locationCode + "',"
                         + "sysdate ,'N','" + strPCode + "','" + strGCode + "','" + strQSite + "')";

            dc.ExeSql(Sql);

            e.Cancel = true;
            ASPxGridView1.CancelEdit();
            setCondition();
        }
Exemplo n.º 29
0
    private void OnLoad(string t)
    {
        int start = 0;     // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize;
        int end   = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize;

        for (int i = start; i < end; i++)
        {
            ASPxCheckBox   isPay   = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns[0], "ack_IsPay") as ASPxCheckBox;
            ASPxTextBox    Id      = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "lb_Id") as ASPxTextBox;
            ASPxButtonEdit driver  = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "btn_DriverCode") as ASPxButtonEdit;
            ASPxButtonEdit towhead = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["VehicleNo"], "btn_vehicle") as ASPxButtonEdit;
            ASPxDateEdit   bkgDate = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["BkgDate"], "txt_BkgDate") as ASPxDateEdit;
            ASPxTextBox    bkgTime = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["BkgTime"], "txt_BkgTime") as ASPxTextBox;
            ASPxComboBox   trip    = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["TripCode"], "cbb_Trip_TripCode") as ASPxComboBox;

            if (Id != null && isPay != null && isPay.Checked)
            {
                list.Add(new Record(Id.Text, driver.Text, towhead.Text, bkgDate.Date, bkgTime.Text, SafeValue.SafeString(trip.Value)));
            }
            else if (Id == null)
            {
                break;
            }
        }
    }
Exemplo n.º 30
0
    private string create_house(int count, int index, string jobNo)
    {
        string   result = "";
        DateTime now    = DateTime.Now;

        string refNo  = "";
        bool   action = false;
        string userId = HttpContext.Current.User.Identity.Name;

        if (count > 0 || index > -1)
        {
            #region 处理逻辑


            for (int i = 0; i < count; i++)
            {
                int      id        = list[i].id;
                int      shipIndex = list[i].shipIndex;
                DateTime shipDate  = list[i].shipDate;
                string   postCode  = list[i].postCode;
                string   contIndex = list[i].contIndex;
                decimal  qty       = list[i].qty;
                decimal  weight    = list[i].weight;
                decimal  volume    = list[i].volume;
                insert_data(jobNo, refNo, id, shipIndex, shipDate, postCode, contIndex, qty, weight, volume);
            }

            if (index > -1)
            {
                #region

                ASPxTextBox  txt_Id           = grid.FindRowCellTemplateControl(index, null, "txt_Id") as ASPxTextBox;
                ASPxDateEdit date_ShipDate    = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipDate"], "date_ShipDate") as ASPxDateEdit;
                ASPxTextBox  txt_ShipIndex    = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipIndex"], "txt_ShipIndex") as ASPxTextBox;
                ASPxTextBox  txt_ShipPortCode = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipPortCode"], "txt_ShipPortCode") as ASPxTextBox;
                ASPxComboBox cbb_ContIndex    = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContIndex"], "cbb_ContIndex") as ASPxComboBox;
                ASPxSpinEdit spin_Qty         = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["QtyOrig"], "spin_Qty") as ASPxSpinEdit;
                ASPxSpinEdit spin_Weight      = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["WeightOrig"], "spin_Weight") as ASPxSpinEdit;
                ASPxSpinEdit spin_Volume      = this.grid.FindRowCellTemplateControl(index, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["VolumeOrig"], "spin_Volume") as ASPxSpinEdit;
                int          id        = SafeValue.SafeInt(txt_Id.Text, 0);
                int          shipIndex = SafeValue.SafeInt(txt_ShipIndex.Text, 0);
                DateTime     shipDate  = date_ShipDate.Date;
                string       postCode  = txt_ShipPortCode.Text;
                string       contIndex = SafeValue.SafeString(cbb_ContIndex.Value);
                decimal      qty       = SafeValue.SafeDecimal(spin_Qty.Value);
                decimal      weight    = SafeValue.SafeDecimal(spin_Weight.Value);
                decimal      volume    = SafeValue.SafeDecimal(spin_Volume.Value);
                insert_data(jobNo, refNo, id, shipIndex, shipDate, postCode, contIndex, qty, weight, volume);

                #endregion
            }
            #endregion
        }
        else
        {
            result = "Pls Select at least one";
        }
        return(result);
    }
Exemplo n.º 31
0
        protected void grdCreator_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView    grid         = sender as ASPxGridView;
            ASPxHiddenField masterKey    = grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["MasterKey"], "ASPxCreatorMasterKeyHiddenField") as ASPxHiddenField;
            ASPxDateEdit    effectDate   = grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["EffectDate"], "CreatorEffectDate") as ASPxDateEdit;
            ASPxComboBox    sCreator     = grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["UserCompleteName"], "Creator") as ASPxComboBox;
            ASPxComboBox    sCreatorStat = grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["StatusDesc"], "CreatorStatus") as ASPxComboBox;

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();

            string sLastModified = DateTime.Now.ToString();

            string insert = "INSERT INTO tbl_System_BusinessUnit_Creator (MasterKey, UserKey, EffectDate, StatusKey) VALUES (@MasterKey, @UserKey, @EffectDate, @StatusKey)";

            SqlCommand cmd = new SqlCommand(insert, conn);

            cmd.Parameters.AddWithValue("@MasterKey", iBUSSUMasterKey.ToString());
            cmd.Parameters.AddWithValue("@UserKey", sCreator.Value.ToString());
            cmd.Parameters.AddWithValue("@EffectDate", effectDate.Value.ToString());
            cmd.Parameters.AddWithValue("@StatusKey", sCreatorStat.Value.ToString());
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();

            string updateMaster = "UPDATE tbl_System_BusinessUnit SET [LastModified] = @LastModified WHERE ([PK] = @PK)";

            SqlCommand cmd1 = new SqlCommand(updateMaster, conn);

            cmd1.Parameters.AddWithValue("@PK", iBUSSUMasterKey.ToString());
            cmd1.Parameters.AddWithValue("@LastModified", sLastModified.ToString());
            cmd1.CommandType = CommandType.Text;
            cmd1.ExecuteNonQuery();

            e.Cancel = true;
            grid.CancelEdit();
            //BindSCMProcOff_Details(Convert.ToInt32(sMasterKey.Value));
            //BindSCMProcOff_Details(iProcOffMaster);

            BindBUSSUListCreator(iBUSSUMasterKey);

            grdBUSSU.Enabled = true;

            int           pk_latest = 0;
            string        query_pk  = "SELECT TOP 1 [PK] FROM tbl_System_BusinessUnit_Creator ORDER BY [PK] DESC";
            SqlCommand    comm      = new SqlCommand(query_pk, conn);
            SqlDataReader r         = comm.ExecuteReader();

            while (r.Read())
            {
                pk_latest = Convert.ToInt32(r[0].ToString());
            }
            conn.Close();

            if (pk_latest > 0)
            {
                FocusThisRowGrid(grid, pk_latest);
            }
        }
Exemplo n.º 32
0
 public static void SetDateEditValue(ASPxDateEdit de, object objects)
 {
     try
     {
         if (objects != null)
             de.Value = DateTime.Parse(objects.ToString());
     }
     catch (Exception ex)
     {
         SiAuto.Main.LogString("Lỗi SetDateEditValue:", ex.ToString());
     }
 }
Exemplo n.º 33
0
    public List<HtmlTableCell> BuildDatetimePicker(string fieldtext, string id, string helptext, string SkinID, bool isReadOnly, string controlValue)
    {
        List<HtmlTableCell> c = new List<HtmlTableCell>();
        try
        {

            HtmlTableCell cell = new HtmlTableCell();
            cell.Attributes.Add("class", "tblFormViewtdLabel");
            cell.Style.Add("Width", "20%");
            ASPxLabel lb = new ASPxLabel() { Text = fieldtext };
            cell.Controls.Add(lb);
            HtmlTableCell celledit = new HtmlTableCell();
            celledit.Attributes.Add("class", "tblFormViewtdValue");
            celledit.Style.Add("Width", "30%");
            ASPxDateEdit date = new ASPxDateEdit();
            date.SkinID = SkinID;
            date.ID = id;
            date.NullText = helptext;
            date.Value = controlValue;
            date.DisplayFormatString = "dd/MM/yyyy";
            //de.Enabled = alowEdit;
            date.Theme = "DevEx";
            date.AutoPostBack = false;
            date.Width = Unit.Percentage(99);
            date.ReadOnly = isReadOnly;
            celledit.Controls.Add(date);
            c.Add(cell);
            c.Add(celledit);
            cot += 2;

        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(),
                                                                        "<script> alert('buildDatetimePicker fieldname" + id + "'); </script>",
                                                                        false);
        }
        return c;
    }
Exemplo n.º 34
0
    public static string GetDateEditValueForCompare(ASPxDateEdit de)
    {
        string result = "";
        try
        {
            result = DateTime.Parse(de.Value.ToString()).ToString("yyyy-MM-dd");
        }
        catch (Exception ex)
        {
            SiAuto.Main.LogString("Lỗi GetDateEditValueForCompare:", ex.ToString());
        }

        return result;
    }