Ejemplo n.º 1
0
    public void InitPageParameter(int customerScheduleId)
    {
        if (customerScheduleId > 0)
        {
            this.customerSchedule = TheCustomerScheduleMgr.LoadCustomerSchedule(customerScheduleId, true);

            this.tbFlow1.Text    = customerSchedule.Flow;
            this.tbFlow1.Visible = true;
            this.tbFlow.Visible  = false;

            this.tbScheduleNo.Text     = customerSchedule.ReferenceScheduleNo;
            this.tbScheduleNo.ReadOnly = true;
            this.trTemplate.Visible    = false;
        }
        else
        {
            this.customerSchedule = null;


            this.tbFlow.Visible  = true;
            this.tbFlow.Text     = string.Empty;
            this.tbFlow1.Visible = false;

            this.tbScheduleNo.ReadOnly = false;
            this.tbScheduleNo.Text     = string.Empty;


            this.trTemplate.Visible = true;
        }
        this.GVDataBind();
    }
Ejemplo n.º 2
0
    public void DoSearch()
    {
        IList <CustomerSchedule> customerScheduleList = TheCustomerScheduleMgr.GetCustomerSchedules(this.tbFlow.Text.Trim(), tbRefOrderNo.Text.Trim(), StatusList, StartDate, EndDate);

        this.GV_List.DataSource = customerScheduleList;
        this.GV_List.DataBind();
        this.fld_Details.Visible = true;
        this.ltl_Result.Visible  = customerScheduleList.Count == 0;
    }
Ejemplo n.º 3
0
 protected void btnRelease_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.customerSchedule != null && this.customerSchedule.Id > 0)
         {
             TheCustomerScheduleMgr.ReleaseCustomerSchedule(this.customerSchedule.Id, this.CurrentUser.Code);
             this.customerSchedule = TheCustomerScheduleMgr.LoadCustomerSchedule(this.customerSchedule.Id, true);
             ShowSuccessMessage("MRP.Schedule.Release.Successfully");
             this.backClickEvent(this, e);
         }
     }
     catch (BusinessErrorException ex)
     {
         ShowErrorMessage(ex);
     }
 }
Ejemplo n.º 4
0
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     try
     {
         TheCustomerScheduleMgr.CancelCustomerSchedule(this.customerSchedule.Id, this.CurrentUser.Code);
         this.backClickEvent(this, e);
         ShowSuccessMessage("MRP.Schedule.Cancel.Successfully");
     }
     catch (BusinessErrorException ex)
     {
         ShowErrorMessage(ex);
     }
     catch (Exception)
     {
         ShowErrorMessage("MRP.Schedule.Cancel.Fail");
     }
 }
Ejemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.customerSchedule.Id > 0)
            {
                this.customerSchedule.LastModifyDate = DateTime.Now;
                this.customerSchedule.LastModifyUser = this.CurrentUser.Code;

                foreach (GridViewRow gvr in this.GV_List_Detail.Rows)
                {
                    TextBox tbQty = (TextBox)gvr.FindControl("tbQty");
                    decimal qty   = decimal.Parse(tbQty.Text.Trim());
                    this.customerSchedule.CustomerScheduleDetails[gvr.RowIndex].Qty = qty;
                }

                TheCustomerScheduleMgr.UpdateCustomerSchedule(this.customerSchedule);
                ShowSuccessMessage("MRP.Schedule.Update.Successfully");
            }
            else
            {
                this.customerSchedule.CreateDate     = DateTime.Now;
                this.customerSchedule.CreateUser     = this.CurrentUser.Code;
                this.customerSchedule.LastModifyDate = DateTime.Now;
                this.customerSchedule.LastModifyUser = this.CurrentUser.Code;
                this.customerSchedule.Status         = BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE;

                foreach (GridViewRow gvr in this.GV_List_Detail.Rows)
                {
                    TextBox tbQty = (TextBox)gvr.FindControl("tbQty");
                    decimal qty   = decimal.Parse(tbQty.Text.Trim());
                    this.customerSchedule.CustomerScheduleDetails[gvr.RowIndex].Qty = qty;
                }

                TheCustomerScheduleMgr.CreateCustomerSchedule(this.customerSchedule);
                ShowSuccessMessage("MRP.Schedule.Create.Successfully");
            }

            this.InitPageParameter(customerSchedule.Id);
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }
Ejemplo n.º 6
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         CustomerSchedule customerSchedule = TheCustomerScheduleMgr.LoadCustomerSchedule(this.customerSchedule.Id, true);
         TheCustomerScheduleMgr.DeleteCustomerSchedule(customerSchedule);
         this.backClickEvent(this, e);
         ShowSuccessMessage("MRP.Schedule.Delete.Successfully");
     }
     catch (BusinessErrorException ex)
     {
         ShowErrorMessage(ex);
     }
     catch (Exception)
     {
         ShowErrorMessage("MRP.Schedule.Delete.Fail");
     }
 }
Ejemplo n.º 7
0
    protected void btnImport_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.tbScheduleNo.Text.Trim() == string.Empty)
            {
                this.rfvScheduleNo.IsValid = false;
                return;
            }

            string flowCode = this.tbFlow.Text.Trim() != string.Empty ? this.tbFlow.Text.Trim() : string.Empty;
            IList <CustomerSchedule> customerScheduleList = TheImportMgr.ReadCustomerScheduleFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser,
                                                                                                     null, null, flowCode, this.tbScheduleNo.Text.Trim(), false);
            if (customerScheduleList.Count > 0)
            {
                foreach (CustomerSchedule c in customerScheduleList)
                {
                    c.CreateDate     = DateTime.Now;
                    c.CreateUser     = this.CurrentUser.Code;
                    c.LastModifyDate = DateTime.Now;
                    c.LastModifyUser = this.CurrentUser.Code;
                    c.Status         = BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE;
                    TheCustomerScheduleMgr.CreateCustomerSchedule(c);
                    TheCustomerScheduleMgr.ReleaseCustomerSchedule(c.Id, this.CurrentUser.Code);
                }
                ShowSuccessMessage("MRP.Schedule.Create.Successfully");

                if (this.backClickEvent != null)
                {
                    this.backClickEvent(this, e);
                }
            }
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }