Exemple #1
0
        public bool AddMNotification(MNotification mnotification)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMNotification";

            cmd.Parameters.AddWithValue("@NotifyNo", mnotification.NotifyNo);

            cmd.Parameters.AddWithValue("@NotifyType", mnotification.NotifyType);

            cmd.Parameters.AddWithValue("@NotifyMessage", mnotification.NotifyMessage);

            cmd.Parameters.AddWithValue("@NotifyDate", mnotification.NotifyDate);

            cmd.Parameters.AddWithValue("@NotifyStatus", mnotification.NotifyStatus);

            cmd.Parameters.AddWithValue("@NotifyFileName", mnotification.NotifyFileName);

            cmd.Parameters.AddWithValue("@CompanyNo", mnotification.CompanyNo);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #2
0
        public bool AddTSeasonalItems(TSeasonalItems tseasonalitems)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTSeasonalItems";

            cmd.Parameters.AddWithValue("@PKSrNo", tseasonalitems.PKSrNo);

            cmd.Parameters.AddWithValue("@BillNo", tseasonalitems.BillNo);

            cmd.Parameters.AddWithValue("@ItemName", tseasonalitems.ItemName);

            cmd.Parameters.AddWithValue("@MRP", tseasonalitems.MRP);

            cmd.Parameters.AddWithValue("@Qty", tseasonalitems.Qty);

            cmd.Parameters.AddWithValue("@Barcode", tseasonalitems.Barcode);

            cmd.Parameters.AddWithValue("@IsPrint", tseasonalitems.IsPrint);

            cmd.Parameters.AddWithValue("@UserID", tseasonalitems.UserID);

            cmd.Parameters.AddWithValue("@UserDate", tseasonalitems.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
        public bool AddMGodownSetting(MGodownSetting mgodownsetting)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMGodownSetting";

            cmd.Parameters.AddWithValue("@PkGodownSettingNo", mgodownsetting.PkGodownSettingNo);

            cmd.Parameters.AddWithValue("@FkBcdSrNo", mgodownsetting.FkBcdSrNo);

            cmd.Parameters.AddWithValue("@ItemNo", mgodownsetting.ItemNo);

            cmd.Parameters.AddWithValue("@UOMNo", mgodownsetting.UOMNo);

            cmd.Parameters.AddWithValue("@QuantitySlabFrom", mgodownsetting.QuantitySlabFrom);

            cmd.Parameters.AddWithValue("@QuantitySlabTo", mgodownsetting.QuantitySlabTo);

            cmd.Parameters.AddWithValue("@GodownNo", mgodownsetting.GodownNo);

            cmd.Parameters.AddWithValue("@UserID", mgodownsetting.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mgodownsetting.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #4
0
        public bool AddMPayType(MPayType mpaytype)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMPayType";

            cmd.Parameters.AddWithValue("@PKPayTypeNo", mpaytype.PKPayTypeNo);

            cmd.Parameters.AddWithValue("@PayTypeName", mpaytype.PayTypeName);

            cmd.Parameters.AddWithValue("@ShortName", mpaytype.ShortName);

            cmd.Parameters.AddWithValue("@IsActive", mpaytype.IsActive);

            cmd.Parameters.AddWithValue("@ControlUnder", mpaytype.ControlUnder);

            cmd.Parameters.AddWithValue("@CompanyNo", mpaytype.CompanyNo);

            cmd.Parameters.AddWithValue("@UserID", mpaytype.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mpaytype.UserDate);

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
        public bool AddMRegistration(MRegistration mregistration)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMRegistration";

            cmd.Parameters.AddWithValue("@RegNo", mregistration.RegNo);

            cmd.Parameters.AddWithValue("@MacID", secure.psEncrypt(mregistration.MacID));

            cmd.Parameters.AddWithValue("@HostName", mregistration.HostName);

            cmd.Parameters.AddWithValue("@MachineIP", mregistration.MachineIP);

            cmd.Parameters.AddWithValue("@IsActive", mregistration.IsActive);

            cmd.Parameters.AddWithValue("@IsManual", mregistration.IsManual);

            cmd.Parameters.AddWithValue("@CompanyNo", mregistration.CompanyNo);

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #6
0
        public bool AddTCashSlip(TCashSlip TCashSlip)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTCashSlip";

            cmd.Parameters.AddWithValue("@CashSlipNo", TCashSlip.CashSlipNo);

            cmd.Parameters.AddWithValue("@DocketUserNo", TCashSlip.DocketUserNo);

            cmd.Parameters.AddWithValue("@ToDate", TCashSlip.ToDate);

            cmd.Parameters.AddWithValue("@LedgerNo", TCashSlip.LedgerNo);

            cmd.Parameters.AddWithValue("@UserID", TCashSlip.UserID);

            cmd.Parameters.AddWithValue("@UserDate", TCashSlip.UserDate);

            cmd.Parameters.AddWithValue("@CompanyNo", TCashSlip.CompanyNo);


            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);

            return(true);
        }
        public void PackageNotFoundThrown_ReturnCodeIsMinusTwo()
        {
            _command.Setup(x => x.Execute()).Throws(new NoPackageFoundException("App"));
            _collection.Add(_command.Object);

            var returnCode = _collection.RunAll();

            Assert.That(returnCode, Is.EqualTo(-2));
        }
Exemple #8
0
        public bool AddAppSettings(AppSettings app, string strVal)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "Update MSettings set SettingValue = N'" + strVal + "',StatusNo=2 where PKSettingNo=" + (int)app + "";

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #9
0
        public bool AddMRacInv(MRank mRank)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMRacInv";

            cmd.Parameters.AddWithValue("@RacInvNo", mRank.RacInvNo);

            //cmd.Parameters.AddWithValue("@CityName", mcity.CityName);

            cmd.Parameters.AddWithValue("@ItemNo", mRank.ItemNo);

            // cmd.Parameters.AddWithValue("@Uom", mRank.UOM);
            // cmd.Parameters.AddWithValue("@Quantity", mRank.Quantity);

            //cmd.Parameters.AddWithValue("@CountryNo", mcity.CountryNo);

            //cmd.Parameters.AddWithValue("@StateNo", mcity.StateNo);

            //cmd.Parameters.AddWithValue("@RegionNo", mcity.RegionNo);

            cmd.Parameters.AddWithValue("@IsActive", mRank.IsActive);

            cmd.Parameters.AddWithValue("@UserID", mRank.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mRank.UserDate);


            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);

            // cmd.Parameters.AddWithValue("@CompanyNo", mcity.CompanyNo);

            //cmd.Parameters.AddWithValue("@ModifiedBy", mcity.ModifiedBy);
            //if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            //{
            //    return true;
            //}
            //else
            //{
            //    mRank.msg = ObjTrans.ErrorMessage;
            //    return false;
            //}
        }
Exemple #10
0
        public bool AddMRecipeMain(MRecipeMain RecipeMain)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMRecipeMain";

            cmd.Parameters.AddWithValue("@MRecipeID", RecipeMain.MRecipeID);

            cmd.Parameters.AddWithValue("@DocNo", RecipeMain.DocNo);

            cmd.Parameters.AddWithValue("@ESFlag", RecipeMain.ESFlag);

            cmd.Parameters.AddWithValue("@GroupNo ", RecipeMain.GroupNo);

            cmd.Parameters.AddWithValue("@FinishItemID", RecipeMain.FinishItemID);

            cmd.Parameters.AddWithValue("@PackingSize", RecipeMain.PackingSize);

            cmd.Parameters.AddWithValue("@RDate", RecipeMain.RDate);

            cmd.Parameters.AddWithValue("@Qty", RecipeMain.Qty);

            cmd.Parameters.AddWithValue("@ProdQty", RecipeMain.ProdQty);

            cmd.Parameters.AddWithValue("@UomNo", RecipeMain.UomNo);

            cmd.Parameters.AddWithValue("@RecipeType", RecipeMain.RecipeType);

            cmd.Parameters.AddWithValue("@FkRecipeID", RecipeMain.FkRecipeID);

            cmd.Parameters.AddWithValue("@IsLock", RecipeMain.IsLock);

            cmd.Parameters.AddWithValue("@IsActive", RecipeMain.IsActive);

            cmd.Parameters.AddWithValue("@UserID", RecipeMain.UserID);

            cmd.Parameters.AddWithValue("@UserDate", RecipeMain.UserDate);

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #11
0
        public bool AddTSeasonalBarCodePrint(TSeasonalBarCodePrint tbarcodeprint)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTSeasonalBarCodePrint";

            cmd.Parameters.AddWithValue("@PkSrNo", tbarcodeprint.PkSrNo);

            cmd.Parameters.AddWithValue("@BillNo", tbarcodeprint.BillNo);

            cmd.Parameters.AddWithValue("@ItemName", tbarcodeprint.ItemName);

            cmd.Parameters.AddWithValue("@MRP", tbarcodeprint.MRP);

            cmd.Parameters.AddWithValue("@Qty", tbarcodeprint.Qty);

            cmd.Parameters.AddWithValue("@Barcode", tbarcodeprint.Barcode);

            cmd.Parameters.AddWithValue("@UserID", tbarcodeprint.UserID);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #12
0
        /// <summary>
        /// Add a command to construct a command pipeline.
        /// For example, to construct a command string "get-process | sort-object",
        ///     <code>
        ///         PSCommand command = new PSCommand("get-process").AddCommand("sort-object");
        ///     </code>
        /// </summary>
        /// <param name="command">
        /// A string representing the command.
        /// </param>
        /// <exception cref="InvalidPowerShellStateException">
        /// Powershell instance cannot be changed in its
        /// current state.
        /// </exception>
        /// <returns>
        /// A PSCommand instance with <paramref name="cmdlet"/> added.
        /// </returns>
        /// <remarks>
        /// This method is not thread safe.
        /// </remarks>
        /// <exception cref="ArgumentNullException">
        /// cmdlet is null.
        /// </exception>
        public PSCommand AddCommand(string command)
        {
            if (null == command)
            {
                throw PSTraceSource.NewArgumentNullException("cmdlet");
            }
            if (_owner != null)
            {
                _owner.AssertChangesAreAccepted();
            }

            _currentCommand = new Command(command, false);
            _commands.Add(_currentCommand);

            return(this);
        }
Exemple #13
0
        public bool AddMStockCountType(MStockCountType mstockcounttype)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMStockCountType";

            cmd.Parameters.AddWithValue("@CountTypeNo", mstockcounttype.CountTypeNo);

//            cmd.Parameters.AddWithValue("@CountTypeName", mstockcounttype.CountTypeName);

            cmd.Parameters.AddWithValue("@DefaultValue", mstockcounttype.DefaultValue);

            cmd.Parameters.AddWithValue("@IsActive", mstockcounttype.IsActive);

            cmd.Parameters.AddWithValue("@CompanyNo", mstockcounttype.CompanyNo);

            cmd.Parameters.AddWithValue("@UserDate", mstockcounttype.UserDate);

            cmd.Parameters.AddWithValue("@UserID", mstockcounttype.UserID);


            commandcollection.Add(cmd);
            return(true);
        }
        public bool AddMStockCountSchedule(MStockCountSchedule mstockcountschedule)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMStockCountSchedule";

            cmd.Parameters.AddWithValue("@PkSrNo", mstockcountschedule.PkSrNo);

            cmd.Parameters.AddWithValue("@ItemNo", mstockcountschedule.ItemNo);

            cmd.Parameters.AddWithValue("@CountTypeNo", mstockcountschedule.CountTypeNo);

            cmd.Parameters.AddWithValue("@CountScheduleDate", mstockcountschedule.CountScheduleDate);

            cmd.Parameters.AddWithValue("@IsActive", mstockcountschedule.IsActive);

            cmd.Parameters.AddWithValue("@CompanyNo", mstockcountschedule.CompanyNo);

            cmd.Parameters.AddWithValue("@UserID", mstockcountschedule.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mstockcountschedule.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #15
0
        private void Current_CommandLoaded(object sender, CommandLoadedEventArgs e)
        {
            var command = (Command)Activator.CreateInstance(e.NewCommandType);

            CommandCollection.Add(command);
            CommandDictionary.Add(command.Identifier, command);
        }
        public bool AddTPackingListDetails(TPackingListDetails tpackinglistdetails)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTPackingListDetails";

            cmd.Parameters.AddWithValue("@PackingListNo", tpackinglistdetails.PackingListNo);

            cmd.Parameters.AddWithValue("@FkVoucherNo", tpackinglistdetails.FkVoucherNo);

            cmd.Parameters.AddWithValue("@ItemNo", tpackinglistdetails.ItemNo);

            cmd.Parameters.AddWithValue("@Quantity", tpackinglistdetails.Quantity);

            cmd.Parameters.AddWithValue("@BagNo", tpackinglistdetails.BagNo);

            cmd.Parameters.AddWithValue("@CompanyNo", tpackinglistdetails.CompanyNo);

            cmd.Parameters.AddWithValue("@GroupNo", tpackinglistdetails.GroupNo);

            cmd.Parameters.AddWithValue("@FkStockTrnNo", tpackinglistdetails.FkStockTrnNo);

            cmd.Parameters.AddWithValue("@UserID", tpackinglistdetails.UserID);

            cmd.Parameters.AddWithValue("@UserDate", tpackinglistdetails.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #17
0
        public bool AddMItemTaxInfo1(MItemTaxInfo mitemtaxinfo)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMItemTaxInfo";

            cmd.Parameters.AddWithValue("@PkSrNo", mitemtaxinfo.PkSrNo);

            cmd.Parameters.AddWithValue("@ItemNo", mitemtaxinfo.ItemNo);

            cmd.Parameters.AddWithValue("@TaxLedgerNo", mitemtaxinfo.TaxLedgerNo);

            cmd.Parameters.AddWithValue("@SalesLedgerNo", mitemtaxinfo.SalesLedgerNo);

            cmd.Parameters.AddWithValue("@FromDate", mitemtaxinfo.FromDate);

            cmd.Parameters.AddWithValue("@CalculationMethod", mitemtaxinfo.CalculationMethod);

            cmd.Parameters.AddWithValue("@Percentage", mitemtaxinfo.Percentage);

            cmd.Parameters.AddWithValue("@CompanyNo", mitemtaxinfo.CompanyNo);

            cmd.Parameters.AddWithValue("@FKTaxSettingNo", mitemtaxinfo.FKTaxSettingNo);

            cmd.Parameters.AddWithValue("@UserID", mitemtaxinfo.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mitemtaxinfo.UserDate);

            //cmd.Parameters.AddWithValue("@ModifiedBy", mitemtaxinfo.ModifiedBy);
            commandcollection.Add(cmd);

            return(true);
        }
Exemple #18
0
        public bool AddMLedgerGroup(MLedgerGroup MLedgerGroup)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMLedgerGroup";

            cmd.Parameters.AddWithValue("@LedgerGroupNo", MLedgerGroup.LedgerGroupNo);

            cmd.Parameters.AddWithValue("@LedgerName", MLedgerGroup.LedgerName);

            cmd.Parameters.AddWithValue("@LedgerLangName", MLedgerGroup.LedgerLangName);

            cmd.Parameters.AddWithValue("@GroupNo", MLedgerGroup.GroupNo);

            cmd.Parameters.AddWithValue("@IsActive", MLedgerGroup.IsActive);

            cmd.Parameters.AddWithValue("@UserID", MLedgerGroup.UserID);

            cmd.Parameters.AddWithValue("@UserDate", MLedgerGroup.UserDate);

            cmd.Parameters.AddWithValue("@CompanyNo", MLedgerGroup.CompanyNo);

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);
            commandcollection.Add(cmd);
            return(true);
        }
Exemple #19
0
        /// <summary>
        /// コマンドのグループ化終了
        /// </summary>
        public static void EndCollection()
        {
            if (cmd_collections_count == 0)
            {
                throw new InvalidOperationException("Collection has not yet start.");
            }
            cmd_collections_count--;

            if (cmd_collections_count == 0)
            {
                if (cmd_collections.Count == 0)
                {
                    return;
                }

                var command = new CommandCollection();
                foreach (var cmd in cmd_collections)
                {
                    command.Add(cmd);
                }

                if (cmds.Count > cmds_ind)
                {
                    cmds.RemoveRange(cmds_ind, cmds.Count - cmds_ind);
                }

                cmds.Add(command);
                cmds_ind++;

                cmd_collections.Clear();
            }
        }
Exemple #20
0
        /// <summary>
        /// Constructs a remote pipeline for the specified runspace and
        /// specified command.
        /// </summary>
        /// <param name="runspace">Runspace in which to create the pipeline.</param>
        /// <param name="command">Command as a string, to be used in pipeline creation.</param>
        /// <param name="addToHistory">Whether to add the command to the runspaces history.</param>
        /// <param name="isNested">Whether this pipeline is nested.</param>
        internal RemotePipeline(RemoteRunspace runspace, string command, bool addToHistory, bool isNested)
            : this(runspace, addToHistory, isNested)
        {
            if (command != null)
            {
                _commands.Add(new Command(command, true));
            }

            // initialize the underlying powershell object
            _powershell = new PowerShell(_inputStream, _outputStream, _errorStream,
                                         ((RemoteRunspace)_runspace).RunspacePool);

            _powershell.SetIsNested(isNested);

            _powershell.InvocationStateChanged += HandleInvocationStateChanged;
        }
Exemple #21
0
    public static bool ParseCommands(object context, TextReader reader, string line, ref int lineNumber)
    {
        if (string.IsNullOrEmpty(line))
        {
            return(true);
        }

        if (line.StartsWith("}"))
        {
            return(false);
        }

        object[]          args    = context as object[];
        Project           project = args[0] as Project;
        CommandCollection cmds    = args[1] as CommandCollection;

        int    start   = 0;
        string command = ReadToken(line, ref start);

        List <Type> commandCandidates = new List <Type>();

        foreach (Type cmd in Commands)
        {
            if (cmd.Name.ToLower().StartsWith(command.ToLower()))
            {
                commandCandidates.Add(cmd);
            }
        }

        if (commandCandidates.Count > 1)
        {
            project.Warnings.Add(string.Format("Line {1}: The command '{0}' is ambiguous.", command, lineNumber));
        }
        else
        {
            Type tp = commandCandidates.Count > 0 ? commandCandidates[0] : null;

            if (tp != null)
            {
                CommandBase c = Activator.CreateInstance(tp) as CommandBase;

                if (c != null)
                {
                    c.LoadCommand(project, reader, line, ref lineNumber);
                }
                else
                {
                    project.Warnings.Add(string.Format("Line {1}: The command '{0}' is not valid.", command, lineNumber));
                }

                cmds.Add(c);
            }
            else
            {
                project.Warnings.Add(string.Format("Line {1}: The command '{0}' is not valid.", command, lineNumber));
            }
        }

        return(true);
    }
Exemple #22
0
        public bool AddTVoucherEntryFormDetails(TVoucherEntryFormDetails tvoucherentryformdetails)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTVoucherEntryFormDetails";

            cmd.Parameters.AddWithValue("@PkVoucherFormNo", tvoucherentryformdetails.PkVoucherFormNo);

            cmd.Parameters.AddWithValue("@FkVoucherNo", tvoucherentryformdetails.FkVoucherNo);

            cmd.Parameters.AddWithValue("@VoucherFormDate", tvoucherentryformdetails.VoucherFormDate);

            cmd.Parameters.AddWithValue("@FormNo", tvoucherentryformdetails.FormNo);

            cmd.Parameters.AddWithValue("@CompanyNo", tvoucherentryformdetails.CompanyNo);

            cmd.Parameters.AddWithValue("@UserID", tvoucherentryformdetails.UserID);

            cmd.Parameters.AddWithValue("@UserDate", tvoucherentryformdetails.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
        public bool AddMStockOrderItems(MStockOrderItems mstockorderitems)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMStockOrderItems";

            cmd.Parameters.AddWithValue("@StockOrderItemNo", mstockorderitems.StockOrderItemNo);

            cmd.Parameters.AddWithValue("@ItemNo", mstockorderitems.ItemNo);

            cmd.Parameters.AddWithValue("@IsUpload", mstockorderitems.IsUpload);

            cmd.Parameters.AddWithValue("@IsGeneral", mstockorderitems.IsGeneral);

            cmd.Parameters.AddWithValue("@MRP", mstockorderitems.MRP);

            cmd.Parameters.AddWithValue("@FKRateSettingNo", mstockorderitems.FKRateSettingNo);

            cmd.Parameters.AddWithValue("@CompanyNo", mstockorderitems.CompanyNo);

            cmd.Parameters.AddWithValue("@StatusNo", mstockorderitems.StatusNo);

            cmd.Parameters.AddWithValue("@UserID", mstockorderitems.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mstockorderitems.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #24
0
        public CommandCollection<ExtensionCommand> GetNodes()
        {
            var cc = new CommandCollection<ExtensionCommand>();
            foreach (var type in AddinManager.NodesAssembly.GetTypes())
            {
                if (reference != null)
                {
                    foreach (XmlNode child in reference.ChildNodes)
                    {
                        if (child.Name == type.Name)
                        {
                            var ec = new ExtensionCommand
                                     {
                                         Name = child.Name,
                                         atts = child.Attributes,
                                         reference = child
                                     };

                            ec.Ass = AddinManager.NodesAssembly;

                            cc.Add((ExtensionCommand)ec.Populate(type));
                        }
                    }
                }
            }
            return cc;
        }
Exemple #25
0
        public bool AddTranspotorDetail(TranspotorDetail mTranspotorDetail)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddTranspotorDetail";


            cmd.Parameters.AddWithValue("@PkTranspotorDetail", mTranspotorDetail.PkTranspotorDetail);
            //cmd.Parameters.AddWithValue("@FKEWayNo", mTranspotorDetail.FKEWayNo);
            //cmd.Parameters.AddWithValue("@FkVoucherNo", mTranspotorDetail.FkVoucherNo);
            cmd.Parameters.AddWithValue("@NoOfQty", mTranspotorDetail.NoOfQty);
            cmd.Parameters.AddWithValue("@BalancedQty", mTranspotorDetail.BalancedQty);
            cmd.Parameters.AddWithValue("@ReceivedQty", mTranspotorDetail.ReceivedQty);
            cmd.Parameters.AddWithValue("@msg", mTranspotorDetail.msg);

            //if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            //{
            //    return true;
            //}
            //else
            //{
            //    mTranspotorDetail.msg = ObjTrans.ErrorMessage;
            //    return false;
            //}
            commandcollection.Add(cmd);
            return(true);
        }
Exemple #26
0
        public bool AddMFirm(MFirm Mfirm)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMFirm";
            cmd.Parameters.AddWithValue("@FirmNo", Mfirm.FirmNo);
            cmd.Parameters.AddWithValue("@FirmName", Mfirm.FirmName);
            cmd.Parameters.AddWithValue("@ShortName", Mfirm.ShortName);
            cmd.Parameters.AddWithValue("@Address", Mfirm.Address);
            cmd.Parameters.AddWithValue("@StateNo", Mfirm.StateNo);
            cmd.Parameters.AddWithValue("@StateCode", Mfirm.StateCode);
            cmd.Parameters.AddWithValue("@CityNo", Mfirm.CityNo);
            cmd.Parameters.AddWithValue("@Pincode", Mfirm.Pincode);
            cmd.Parameters.AddWithValue("@EmailID", Mfirm.EmailID);
            cmd.Parameters.AddWithValue("@PhoneNo1", Mfirm.PhoneNo1);
            cmd.Parameters.AddWithValue("@PhoneNo2", Mfirm.PhoneNo2);
            cmd.Parameters.AddWithValue("@MobileNo1", Mfirm.MobileNo1);
            cmd.Parameters.AddWithValue("@MobileNo2", Mfirm.MobileNo2);
            cmd.Parameters.AddWithValue("@TermAndCondition", Mfirm.TermAndCondition);
            cmd.Parameters.AddWithValue("@GSTNo", Mfirm.GSTNo);
            cmd.Parameters.AddWithValue("@FSSAINo", Mfirm.FSSAINo);
            cmd.Parameters.AddWithValue("@PANNo", Mfirm.PANNo);
            cmd.Parameters.AddWithValue("@AdharNo", Mfirm.AdharNo);
            cmd.Parameters.AddWithValue("@AnyotherNo1", Mfirm.AnyotherNo1);
            cmd.Parameters.AddWithValue("@AnyotherNo2", Mfirm.AnyotherNo2);
            cmd.Parameters.AddWithValue("@GSTDate", Mfirm.GSTDate);
            cmd.Parameters.AddWithValue("@FSSAIDate", Mfirm.FSSAIDate);
            cmd.Parameters.AddWithValue("@IsType", Mfirm.IsType);
            cmd.Parameters.AddWithValue("@IsActive", Mfirm.IsActive);
            cmd.Parameters.AddWithValue("@UserID", Mfirm.UserID);
            cmd.Parameters.AddWithValue("@UserDate", Mfirm.UserDate);
            cmd.Parameters.AddWithValue("@PrinterName", Mfirm.PrinterName);
            cmd.Parameters.AddWithValue("@CompanyType", Mfirm.CompanyType);
            //---GST--//
            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #27
0
        public void Add()
        {
            var collection = new CommandCollection();

            collection.Add(new PressCommand(Button.Select));

            Assert.AreEqual(1, collection.Count());
        }
        public bool AddMStockItemsIngredient(MStockItemsIngredient mstockitemsingredient)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMStockItemsIngredient";

            cmd.Parameters.AddWithValue("@PkSrNo", mstockitemsingredient.PkSrNo);

            cmd.Parameters.AddWithValue("@IngredientValue", mstockitemsingredient.IngredientValue);

            cmd.Parameters.AddWithValue("@NutritionHeadValue", mstockitemsingredient.NutritionHeadValue);

            cmd.Parameters.AddWithValue("@ReceipeHead1", mstockitemsingredient.ReceipeHead1);

            cmd.Parameters.AddWithValue("@ReceipeHead2", mstockitemsingredient.ReceipeHead2);

            cmd.Parameters.AddWithValue("@ReceipeHead3", mstockitemsingredient.ReceipeHead3);

            cmd.Parameters.AddWithValue("@LangReceipeHead1", mstockitemsingredient.LangReceipeHead1);

            cmd.Parameters.AddWithValue("@LangReceipeHead2", mstockitemsingredient.LangReceipeHead2);

            cmd.Parameters.AddWithValue("@LangReceipeHead3", mstockitemsingredient.LangReceipeHead3);

            cmd.Parameters.AddWithValue("@ItemNo", mstockitemsingredient.ItemNo);

            cmd.Parameters.AddWithValue("@UserID", mstockitemsingredient.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mstockitemsingredient.UserDate);

            cmd.Parameters.AddWithValue("@CompanyNo", mstockitemsingredient.CompanyNo);


            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
Exemple #29
0
 /// <summary>
 /// 创建SQL命令
 /// </summary>
 /// <param name="regional"></param>
 public void CreateSQLCommand(RegionalModel regional)
 {
     if (regional != null)
     {
         string sql = $"INSERT INTO RegionalData (RegionalDataOID,ID,Name,ParentOID) VALUES('{regional.RegionalDataOID}','{regional.ID}','{regional.Name}','{regional.ParentOID}')";
         log.Information(sql);
         collection.Add(new Command(sql, regional));
         dbContext.ExecuteSql(sql, regional);
     }
 }
Exemple #30
0
        /// <summary>
        /// Initializes the instance. Called from the constructor.
        /// </summary>
        /// <param name="command">
        /// Command to initialize the instance with.
        /// </param>
        /// <param name="isScript">
        /// true if the <paramref name="command"/> is script,
        /// false otherwise.
        /// </param>
        /// <param name="useLocalScope">
        /// if true local scope is used to run the script command.
        /// </param>
        /// <remarks>
        /// Caller should check the input.
        /// </remarks>
        /// <exception cref="ArgumentNullException">
        /// command is null
        /// </exception>
        private void Initialize(string command, bool isScript, bool?useLocalScope)
        {
            _commands = new CommandCollection();

            if (command != null)
            {
                _currentCommand = new Command(command, isScript, useLocalScope);
                _commands.Add(_currentCommand);
            }
        }
Exemple #31
0
        private void InternalExecute(ICommand command)
        {
            CommandCollection cmds = new CommandCollection(1);

            cmds.Add(command);

            var resultCommand = Execute(StorageEngineDescriptor, cmds)[0];

            SetResult(command, resultCommand);
        }
Exemple #32
0
 /// <summary>
 /// Internal copy constructor
 /// </summary>
 /// <param name="commandToClone"></param>
 internal PSCommand(PSCommand commandToClone)
 {
     _commands = new CommandCollection();
     foreach (Command command in commandToClone.Commands)
     {
         Command clone = command.Clone();
         // Attach the cloned Command to this instance.
         _commands.Add(clone);
         _currentCommand = clone;
     }
 }
Exemple #33
0
 /// <summary>
 /// Creates a PSCommand from the specified command
 /// </summary>
 /// <param name="command">Command object to use</param>
 internal PSCommand(Command command)
 {
     _currentCommand = command;
     _commands = new CommandCollection();
     _commands.Add(_currentCommand);
 }
Exemple #34
0
        internal Collection<PSObject> ExecuteCommandHelper(Pipeline tempPipeline, out Exception exceptionThrown, ExecutionOptions options)
        {
            Dbg.Assert(tempPipeline != null, "command should have a value");

            exceptionThrown = null;

            Collection<PSObject> results = null;

            if ((options & ExecutionOptions.AddOutputter) > 0)
            {
                if (tempPipeline.Commands.Count < 2)
                {
                    if (tempPipeline.Commands.Count == 1)
                    {
                        // Tell the script command to merge it's output and error streams.
                        tempPipeline.Commands[0].MergeMyResults(PipelineResultTypes.Error, PipelineResultTypes.Output);
                    }

                    // Add Out-Default to the pipeline to render.
                    tempPipeline.Commands.Add(GetOutDefaultCommand(endOfStatement: false));
                }
                else
                {
                    // For multiple commands/scripts we need to insert Out-Default at the end of each statement.
                    CommandCollection executeCommands = new CommandCollection();
                    foreach (var cmd in tempPipeline.Commands)
                    {
                        executeCommands.Add(cmd);

                        if (cmd.IsEndOfStatement)
                        {
                            // End of statement needs to pipe to Out-Default.
                            cmd.IsEndOfStatement = false;
                            executeCommands.Add(GetOutDefaultCommand(endOfStatement: true));
                        }
                    }

                    var lastCmd = executeCommands.Last();
                    if (!((lastCmd.CommandText != null) &&
                          (lastCmd.CommandText.Equals("Out-Default", StringComparison.OrdinalIgnoreCase)))
                       )
                    {
                        // Ensure pipeline output goes to Out-Default.
                        executeCommands.Add(GetOutDefaultCommand(endOfStatement: false));
                    }

                    tempPipeline.Commands.Clear();
                    foreach (var cmd in executeCommands)
                    {
                        tempPipeline.Commands.Add(cmd);
                    }
                }
            }

            Executor oldCurrent = CurrentExecutor;
            CurrentExecutor = this;

            lock (_instanceStateLock)
            {
                Dbg.Assert(_pipeline == null, "no other pipeline should exist");
                _pipeline = tempPipeline;
            }

            try
            {
                // blocks until all results are retrieved.
                results = tempPipeline.Invoke();
            }
            catch (Exception e)
            {
                ConsoleHost.CheckForSevereException(e);
                exceptionThrown = e;
            }
            finally
            {
                // Once we have the results, or an exception is thrown, we throw away the pipeline.

                _parent.ui.ResetProgress();
                CurrentExecutor = oldCurrent;
                Reset();
            }

            return results;
        }
Exemple #35
0
        /// <summary>
        /// Initializes the instance. Called from the constructor.
        /// </summary>
        /// <param name="command">
        /// Command to initialize the instance with.
        /// </param>
        /// <param name="isScript">
        /// true if the <paramref name="command"/> is script,
        /// false otherwise.
        /// </param>
        /// <param name="useLocalScope">
        /// if true local scope is used to run the script command.
        /// </param>
        /// <remarks>
        /// Caller should check the input.
        /// </remarks>
        /// <exception cref="ArgumentNullException">
        /// command is null
        /// </exception>
        private void Initialize(string command, bool isScript, bool? useLocalScope)
        {
            _commands = new CommandCollection();

            if (command != null)
            {
                _currentCommand = new Command(command, isScript, useLocalScope);
                _commands.Add(_currentCommand);
            }
        }
        private void PacketExecute(object state)
        {
            try
            {
                KeyValuePair<ServerConnection, Packet> order = (KeyValuePair<ServerConnection, Packet>)state;

                BinaryReader reader = new BinaryReader(order.Value.Request);
                Message msgRequest = Message.Deserialize(reader, (id) => StorageEngine.Find(id));

                IDescriptor clientDescription = msgRequest.Description;
                CommandCollection resultCommands = new CommandCollection(1);

                try
                {
                    var commands = msgRequest.Commands;

                    if (msgRequest.Description != null) // XTable commands
                    {
                        XTablePortable table = (XTablePortable)StorageEngine.OpenXTablePortable(clientDescription.Name, clientDescription.KeyDataType, clientDescription.RecordDataType);
                        table.Descriptor.Tag = clientDescription.Tag;

                        for (int i = 0; i < commands.Count - 1; i++)
                        {
                            ICommand command = msgRequest.Commands[i];
                            CommandsIIndexExecute[command.Code](table, command);
                        }

                        ICommand resultCommand = CommandsIIndexExecute[msgRequest.Commands[commands.Count - 1].Code](table, msgRequest.Commands[commands.Count - 1]);
                        if (resultCommand != null)
                            resultCommands.Add(resultCommand);

                        table.Flush();
                    }
                    else //Storage engine commands
                    {
                        ICommand command = msgRequest.Commands[commands.Count - 1];

                        var resultCommand = CommandsStorageEngineExecute[command.Code](command);

                        if (resultCommand != null)
                            resultCommands.Add(resultCommand);
                    }
                }
                catch (Exception e)
                {
                    resultCommands.Add(new ExceptionCommand(e.Message));
                }

                MemoryStream ms = new MemoryStream();
                BinaryWriter writer = new BinaryWriter(ms);

                Descriptor responseClientDescription = new Descriptor(-1, "", StructureType.RESERVED, DataType.Boolean, DataType.Boolean, null, null, DateTime.Now, DateTime.Now, DateTime.Now, null);

                Message msgResponse = new Message(msgRequest.Description == null ? responseClientDescription : msgRequest.Description, resultCommands);
                msgResponse.Serialize(writer);

                ms.Position = 0;
                order.Value.Response = ms;
                order.Key.PendingPackets.Add(order.Value);
            }
            catch (Exception exc)
            {
                TcpServer.LogError(exc);
            }
        }