Example #1
0
 internal void ValidateExportedMembers()
 {
     // Check if stuff is already exported. If yes, we're fine
     if (HasExplicitExports ||
         ExportedAliases.Count > 0 ||
         ExportedFunctions.Count > 0 ||
         ExportedVariables.Count > 0 ||
         ExportedCmdlets.Count > 0)
     {
         return;
     }
     if (ModuleType.Equals(ModuleType.Script))
     {
         foreach (var fun in SessionState.Function.GetAllLocal())
         {
             ExportedFunctions.Add(fun.Key, fun.Value);
         }
     }
     else if (ModuleType.Equals(ModuleType.Binary))
     {
         foreach (var cmdlet in SessionState.Cmdlet.GetAllLocal())
         {
             ExportedCmdlets.Add(cmdlet.Key, cmdlet.Value);
         }
     }
 }
Example #2
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);
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.tbMiscOrderRegion.ServiceParameter = "string:" + this.CurrentUser.Code;
        if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GI))
        {
            //this.tbMiscOrderReason.ServiceParameter = "string:" + "StockInReason";
            this.ddlReason.Code = "StockInReason";
        }
        if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GR))
        {
            //this.tbMiscOrderReason.ServiceParameter = "string:" + "StockOutReason";
            this.ddlReason.Code = "StockOutReason";
        }
        if (ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_ADJ))
        {
            //this.tbMiscOrderReason.ServiceParameter = "string:" + "StockAdjReason";
            this.ddlReason.Code = "StockAdjReason";
        }

        this.ddlReason.DataBind();
        this.tbMiscOrderRegion.ServiceParameter = "string:" + this.CurrentUser.Code;
    }