Exemplo n.º 1
0
        public ReturnableDC()
        {
            flgNew     = true;
            flgEdited  = false;
            flgDeleted = false;

            dbID      = 0;
            entryNo   = 0;
            entryDate = DateTime.Now;
            entryType = "INWARD";
            partyName = string.Empty;
            vehicleNo = string.Empty;
            dcNo      = string.Empty;
            dcDate    = DateTime.MinValue;
            plantName = string.Empty;
            vInDate   = DateTime.MinValue;
            vInTime   = DateTime.MinValue;
            vOutDate  = DateTime.MinValue;
            vOutTime  = DateTime.MinValue;

            //RuleBroken("EntryNo", true);
            RuleBroken("EntryDate", true);
            //RuleBroken("EntryType", true);
            RuleBroken("PartyName", true);
            RuleBroken("DCNo", true);
            RuleBroken("DCDate", true);
            RuleBroken("PlantName", true);

            DCItems = new ReturnableDCItemList();
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method provides List of Returnable DCs available in Database.
        /// </summary>
        /// <param name="strWhere">Specifies condition for retrieving records.</param>
        /// <returns>Collection of Returnable DC Objects.</returns>
        public static ReturnableDCItemList GetList(long pEntryNo, DateTime pEntryDate, long pMasterDBID)
        {
            ReturnableDCItemList objList = null;
            string strSql = "Select * from ReturnableDCDetail " +
                            " WHERE ENTRYNO = @entryNo " +
                            " AND ENTRYDATE = @entryDate " +
                            " AND MASTERDBID = @masterDBID " +
                            " ORDER BY DBID";

            using (SqlConnection Conn = new SqlConnection(General.GetSQLConnectionString()))
            {
                using (SqlCommand objCmd = new SqlCommand())
                {
                    objCmd.Connection  = Conn;
                    objCmd.CommandType = CommandType.Text;
                    objCmd.CommandText = strSql;
                    objCmd.Parameters.AddWithValue("@entryNo", pEntryNo);
                    objCmd.Parameters.AddWithValue("@entryDate", pEntryDate);
                    objCmd.Parameters.AddWithValue("@masterDBID", pMasterDBID);

                    try
                    {
                        if (Conn.State != ConnectionState.Open)
                        {
                            Conn.Open();
                        }

                        using (SqlDataReader oReader = objCmd.ExecuteReader())
                        {
                            if (oReader.HasRows)
                            {
                                objList = new ReturnableDCItemList();
                                while (oReader.Read())
                                {
                                    objList.Add(FillDataRecord(oReader));
                                }
                            }
                            oReader.Close();
                            oReader.Dispose();
                        }
                    }
                    catch
                    {
                        throw;
                    }
                }
            }
            return(objList);
        }
Exemplo n.º 3
0
        private void LoadItems()
        {
            ReturnableDCItemList objList = objDC.DCItems;

            lvwItems.Items.Clear();
            if (objList != null)
            {// && objList.Count > 0
                foreach (ReturnableDCItem objItem in objList)
                {
                    ListViewItem lvItem = new ListViewItem();
                    lvItem.Name = Convert.ToString(objItem.DBID);
                    lvItem.Text = objItem.ItemCode;
                    lvItem.SubItems.Add(objItem.ItemDescr);
                    lvItem.SubItems.Add(Convert.ToString(objItem.Qty));
                    lvItem.SubItems.Add(objItem.UnitName);

                    lvwItems.Items.Add(lvItem);
                }
            }
        }