Пример #1
0
    private ASTreeViewNode GetASTNode(string status)
    {
        CodeMaster     codeMaster = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_STATUS, status);
        ASTreeViewNode ast        = new ASTreeViewNode(codeMaster.Description, codeMaster.Value);

        return(ast);
    }
Пример #2
0
 protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         e.Row.Cells[7].Text = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE, e.Row.Cells[7].Text.Trim()).Description;
         // e.Row.Cells[12].Text = string.IsNullOrEmpty(e.Row.Cells[12].Text.Trim()) ? "收货回冲" : e.Row.Cells[12].Text;
     }
 }
Пример #3
0
    private IList <CodeMaster> BindingTypeDataBind()
    {
        IList <CodeMaster> bindingGroup = new List <CodeMaster>();

        bindingGroup.Add(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BINDING_TYPE, BusinessConstants.CODE_MASTER_BINDING_TYPE_VALUE_SUBMIT));
        bindingGroup.Add(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BINDING_TYPE, BusinessConstants.CODE_MASTER_BINDING_TYPE_VALUE_RECEIVE_ASYN));
        bindingGroup.Add(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BINDING_TYPE, BusinessConstants.CODE_MASTER_BINDING_TYPE_VALUE_RECEIVE_SYN));

        return(bindingGroup);
    }
Пример #4
0
 protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CodeMaster type = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_WORKCALENDAR_TYPE, e.Row.Cells[6].Text.Trim());
         if (type != null)
         {
             e.Row.Cells[6].Text = type.Description;
         }
     }
 }
Пример #5
0
    public void updateView(bool needBlank)
    {
        if (MiscOrder == null)
        {
            MiscOrder            = new MiscOrder();
            MiscOrder.CreateUser = this.CurrentUser;
            IList <MiscOrderDetail> miscOrderDetails = new List <MiscOrderDetail>();
            MiscOrder.MiscOrderDetails = miscOrderDetails;

            this.tbMiscOrderRegion.Text     = string.Empty;
            this.tbMiscOrderLocation.Text   = string.Empty;
            this.tbMiscOrderEffectDate.Text = string.Empty;

            this.tbRefNo.Text = string.Empty;
            this.tbMiscOrderDescription.Text           = string.Empty;
            this.tbMiscOrderCreateDate.Text            = DateTime.Now.ToLongDateString();
            this.lbCreateUser.Text                     = this.CurrentUser.Code;
            this.tbMiscOrderID.Text                    = string.Empty;
            this.MiscOrderDetailsGV.Columns[4].Visible = true;
            noEditable(false);
        }
        else
        {
            this.tbMiscOrderID.Text         = MiscOrder.OrderNo;
            this.tbMiscOrderCreateDate.Text = MiscOrder.CreateDate.ToLongDateString();
            this.tvMiscOrderRegion.Text     = MiscOrder.Location == null ? string.Empty : MiscOrder.Location.Region.Name;
            this.tvMiscOrderLocation.Text   = MiscOrder.Location == null ? string.Empty : MiscOrder.Location.Name;
            this.lbRefNo.Text      = MiscOrder.ReferenceOrderNo;
            this.lbCreateUser.Text = MiscOrder.CreateUser.Code;
            if (MiscOrder.Reason != null && MiscOrder.Reason != string.Empty)
            {
                if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GI))
                {
                    this.tvMiscOrderReason.Text = TheCodeMasterMgr.GetCachedCodeMaster("StockInReason", MiscOrder.Reason).Description;
                }
                if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GR))
                {
                    this.tvMiscOrderReason.Text = TheCodeMasterMgr.GetCachedCodeMaster("StockOutReason", MiscOrder.Reason).Description;
                }
                if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_ADJ))
                {
                    this.tvMiscOrderReason.Text = TheCodeMasterMgr.GetCachedCodeMaster("StockAdjReason", MiscOrder.Reason).Description;
                }
            }
            this.tvMiscOrderDescription.Text = MiscOrder.Remark;
            this.tvMiscOrderEffectDate.Text  = MiscOrder.EffectiveDate.ToLongDateString();
            if (MiscOrder.OrderNo != null && MiscOrder.OrderNo.Length > 0)
            {
                this.MiscOrderDetailsGV.Columns[4].Visible = false;
            }
        }
        updateGridView(needBlank);
    }
Пример #6
0
    protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string week = e.Row.Cells[3].Text;
            switch (week)
            {
            case "Monday":
                e.Row.Cells[3].Text = "${Common.Week.Monday}";
                break;

            case "Tuesday":
                e.Row.Cells[3].Text = "${Common.Week.Tuesday}";
                break;

            case "Wednesday":
                e.Row.Cells[3].Text = "${Common.Week.Wednesday}";
                break;

            case "Thursday":
                e.Row.Cells[3].Text = "${Common.Week.Thursday}";
                break;

            case "Friday":
                e.Row.Cells[3].Text = "${Common.Week.Friday}";
                break;

            case "Saturday":
                e.Row.Cells[3].Text = "${Common.Week.Saturday}";
                break;

            case "Sunday":
                e.Row.Cells[3].Text = "${Common.Week.Sunday}";
                break;

            default:
                break;
            }
            CodeMaster type = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_WORKCALENDAR_TYPE, e.Row.Cells[4].Text.Trim());
            if (type != null)
            {
                e.Row.Cells[4].Text = type.Description;
            }
        }
    }
Пример #7
0
    protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].Attributes.Add("title", item.Description);
            e.Row.Cells[2].Attributes.Add("title", item.Description);

            e.Row.Cells[5].Text = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE, e.Row.Cells[5].Text.Trim()).Description;

            if (item != null)
            {
                if (e.Row.Cells[0].Text == item.Code)
                {
                    e.Row.Cells[0].ForeColor = Color.Green;
                }
                if (e.Row.Cells[2].Text == item.Code)
                {
                    e.Row.Cells[2].ForeColor = Color.Green;
                }
            }
        }
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tempThemePage  = this.DDL_ThemePage.SelectedValue;
        tempThemeFrame = this.DDL_ThemeFrame.SelectedValue;

        if (TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE) != null)
        {
            this.DDL_ThemePage.SelectedValue = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE).Value;
        }
        else
        {
            this.DDL_ThemePage.SelectedValue = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE).Value;
        }

        if (TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME) != null)
        {
            this.DDL_ThemeFrame.SelectedValue = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME).Value;
        }
        else
        {
            this.DDL_ThemeFrame.SelectedValue = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME).Value;
        }

        this.DDL_ThemeFrame.DataSource = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME);
        this.DDL_ThemeFrame.DataBind();

        this.DDL_ThemePage.DataSource = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE);
        this.DDL_ThemePage.DataBind();

        //CSModule
        upCS = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.PERMISSION_CATEGORY_TERMINAL);
        if (!IsPostBack)
        {
            this.ddlCSModule.DataSource = ThePermissionMgr.GetALlPermissionsByCategory(BusinessConstants.PERMISSION_CATEGORY_TERMINAL, this.CurrentUser);
            this.ddlCSModule.DataBind();
            if (upCS != null)
            {
                this.ddlCSModule.Text = upCS.Value == null ? string.Empty : upCS.Value;
            }
        }

        //Language
        up           = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_LANGUAGE);
        tempLanguage = this.ddlLanguage.SelectedValue;
        if (up != null)
        {
            this.ddlLanguage.Text = up.Value == null ? string.Empty : up.Value;
        }
        else
        {
            this.ddlLanguage.Text = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_LANGUAGE).Value;
        }

        //清除Tab状态
        if (Request.Cookies["TabStatus"] != null && Request.Cookies["TabStatus"].Value == "Theme")
        {
            this.divRefresh.Visible = true;
            Response.Cookies["TabStatus"].Values.Remove("Theme");
            ShowSuccessMessage("Security.UserPreference.Update.Successfully");
        }
        else
        {
            this.divRefresh.Visible = false;
        }
    }
Пример #9
0
    protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            #region text format
            string week = e.Row.Cells[1].Text;
            switch (week)
            {
            case "Monday":
                e.Row.Cells[1].Text = "${Common.Week.Monday}";
                break;

            case "Tuesday":
                e.Row.Cells[1].Text = "${Common.Week.Tuesday}";
                break;

            case "Wednesday":
                e.Row.Cells[1].Text = "${Common.Week.Wednesday}";
                break;

            case "Thursday":
                e.Row.Cells[1].Text = "${Common.Week.Thursday}";
                break;

            case "Friday":
                e.Row.Cells[1].Text = "${Common.Week.Friday}";
                break;

            case "Saturday":
                e.Row.Cells[1].Text = "${Common.Week.Saturday}";
                break;

            case "Sunday":
                e.Row.Cells[1].Text = "${Common.Week.Sunday}";
                break;

            default:
                break;
            }
            CodeMaster type = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_WORKCALENDAR_TYPE, e.Row.Cells[5].Text.Trim());
            if (type != null)
            {
                e.Row.Cells[5].Text = type.Description;
            }
            #endregion

            //#region border
            //e.Row.Cells[0].Attributes.Add("style", "border:1px   solid   blue");
            //e.Row.Cells[1].Attributes.Add("style", "border:1px   solid   blue");
            //e.Row.Cells[2].Attributes.Add("style", "border:1px   solid   blue");
            //e.Row.Cells[3].Attributes.Add("style", "border:1px   solid   blue");
            //e.Row.Cells[4].Attributes.Add("style", "border:1px   solid   blue");
            //e.Row.Cells[5].Attributes.Add("style", "border:1px   solid   blue");
            //#endregion

            #region add class 休息日和工作日以不同的背景色区分
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if ((String)(DataBinder.Eval(e.Row.DataItem, "Type")) == BusinessConstants.CODE_MASTER_WORKCALENDAR_TYPE_VALUE_WORK)
                {
                    for (int i = 0; i < e.Row.Cells.Count; i++)
                    {
                        e.Row.Cells[i].Attributes.Add("class", "GVRow");
                    }
                }
                else
                {
                    for (int i = 0; i < e.Row.Cells.Count; i++)
                    {
                        e.Row.Cells[i].Attributes.Add("class", "GVAlternatingRow");
                    }
                }
            }
            #endregion
        }
    }
Пример #10
0
 private CodeMaster GetrderType(string orderTypeValue)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_ORDER_TYPE, orderTypeValue));
 }
Пример #11
0
 private CodeMaster GetStatus(string statusValue)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_STATUS, statusValue));
 }
Пример #12
0
 private CodeMaster GetTimePeriodType(string statusValue)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_TIME_PERIOD_TYPE, statusValue));
 }
Пример #13
0
    protected void GV_EntityOpt_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string Seq = ((TextBox)GV_EntityOpt.Rows[e.RowIndex].Cells[0].Controls[1]).Text.ToString().Trim();

        try
        {
            Convert.ToInt16(Seq);
        }
        catch (Exception)
        {
            e.Cancel = true;
            ShowErrorMessage("Common.Int.Error", Seq);
        }

        string Code  = GV_EntityOpt.Rows[e.RowIndex].Cells[1].Text;
        string Value = ((TextBox)GV_EntityOpt.Rows[e.RowIndex].Cells[3].Controls[1]).Text.ToString().Trim();


        if (Value == null || Value == string.Empty)
        {
            e.Cancel = true;
            ShowErrorMessage("Common.String.Empty");
        }
        else
        {
            switch (Code)
            {
            case "MailTo":
            case "SMTPEmailAddr":
                if (!IsValidEmail(Value))
                {
                    e.Cancel = true;
                    ShowErrorMessage("Common.EmailFormat.Error");
                }
                return;

            case "OrderLength":
                try
                {
                    Convert.ToInt16(Value);
                }
                catch (Exception)
                {
                    e.Cancel = true;
                    ShowErrorMessage("Common.Int.Error", Code);
                }
                return;

            default:
                break;
            }

            IList <CodeMaster> list = TheCodeMasterMgr.GetCachedCodeMaster(Code);

            if (list != null)
            {
                bool flag = false;
                foreach (CodeMaster ep in list)
                {
                    if (ep.Value == Value)
                    {
                        flag = true;
                        break;
                    }
                    else
                    {
                        flag = false;
                    }
                }
                if (!flag)
                {
                    e.Cancel = true;
                    ShowErrorMessage("MasterData.EntityOption.Update.Fail", Code);
                }
                else
                {
                    ShowSuccessMessage("MasterData.EntityOption.Update.Successfully", Code);
                }
            }
            else
            {
                ShowSuccessMessage("MasterData.EntityOption.Update.Successfully", Code);
            }
        }
    }
Пример #14
0
    protected void CV_ServerValidate(object source, ServerValidateEventArgs args)
    {
        CustomValidator cv = (CustomValidator)source;

        switch (cv.ID)
        {
        case "cvUom":
            if (TheUomMgr.LoadUom(args.Value) == null)
            {
                ShowWarningMessage("MasterData.Bom.WarningMessage.UomInvalid", args.Value);
                args.IsValid = false;
            }
            break;

        case "cvRateQty":
            try
            {
                Convert.ToDecimal(args.Value);
            }
            catch (Exception)
            {
                ShowWarningMessage("MasterData.BomDetail.WarningMessage.RateQtyError", args.Value);
                args.IsValid = false;
            }
            break;

        case "cvStruType":
            if (TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE, args.Value) == null)
            {
                ShowWarningMessage("MasterData.BomDetail.WarningMessage.StruTypeError");
                args.IsValid = false;
            }
            break;

        case "cvScrapPercentage":
            try
            {
                Convert.ToDecimal(args.Value);
            }
            catch (Exception)
            {
                ShowWarningMessage("MasterData.BomDetail.WarningMessage.ScrapPercentageError");
                args.IsValid = false;
            }
            break;

        case "cvStartTime":
            try
            {
                Convert.ToDateTime(args.Value);
            }
            catch (Exception)
            {
                ShowWarningMessage("MasterData.BomDetail.WarningMessage.StartTimeError");
                args.IsValid = false;
            }
            break;

        case "cvEndTime":
            try
            {
                if (args.Value.Trim() != "")
                {
                    Convert.ToDateTime(args.Value);
                }
            }
            catch (Exception)
            {
                ShowWarningMessage("MasterData.BomDetail.WarningMessage.EndTimeError");
                args.IsValid = false;
            }
            break;

        case "cvLocation":
            if (args.Value.Trim() != "")
            {
                if (TheLocationMgr.LoadLocation(args.Value) == null)
                {
                    ShowWarningMessage("MasterData.BomDetail.WarningMessage.LocationError", args.Value);
                    args.IsValid = false;
                }
            }
            break;

        default:
            break;
        }
    }
Пример #15
0
 private CodeMaster GetVehicleType(string vehicleType)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.TRANSPORTATION_VEHICLE_TYPE, vehicleType));
 }
Пример #16
0
 private CodeMaster GetorderSubType(string type)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE, type));
 }
Пример #17
0
 private CodeMaster GetBillSettleTerm(string billSettleTermValue)
 {
     return(TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BILL_SETTLE_TERM, billSettleTermValue));
 }