コード例 #1
0
        public System.Data.DataTable ListAsDataTable(CreditMemoStatus CreditMemoStatus, string SortField = "CreditMemoID", SortOption SortOrder = SortOption.Ascending)
        {
            string SQL = SQLSelect() + "WHERE CreditMemoStatus = @CreditMemoStatus ORDER BY " + SortField;

            if (SortOrder == SortOption.Ascending)
            {
                SQL += " ASC";
            }
            else
            {
                SQL += " DESC";
            }

            MySqlCommand cmd = new MySqlCommand();

            cmd.CommandType = System.Data.CommandType.Text;
            cmd.CommandText = SQL;

            cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));

            string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);

            base.MySqlDataAdapterFill(cmd, dt);

            return(dt);
        }
コード例 #2
0
        public MySqlDataReader List(CreditMemoStatus CreditMemoStatus, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                string SQL = SQLSelect() + "AND CreditMemoStatus = @CreditMemoStatus " +
                             "AND PostingDate BETWEEN @StartDate AND @EndDate " +
                             "ORDER BY CreditMemoID ASC";



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@StartDate", StartDate.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@EndDate", EndDate.ToString("yyyy-MM-dd HH:mm:ss"));

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return(myReader);
            }
            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
コード例 #3
0
        public MySqlDataReader List(CreditMemoStatus CreditMemoStatus, long CustomerID, string SortField, SortOption SortOrder)
        {
            try
            {
                string SQL = SQLSelect() + "AND CreditMemoStatus = @CreditMemoStatus " +
                             "AND CustomerID = @CustomerID " +
                             "ORDER BY " + SortField;

                if (SortOrder == SortOption.Ascending)
                {
                    SQL += " ASC";
                }
                else
                {
                    SQL += " DESC";
                }



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@CustomerID", CustomerID);

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return(myReader);
            }
            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
コード例 #4
0
        protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {
                LoadSortFieldOptions(e);
            }
            else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["CreditMemoID"].ToString();

                HyperLink lnkReturnNo = (HyperLink)e.Item.FindControl("lnkReturnNo");
                lnkReturnNo.Text = dr["CNNo"].ToString();
                Common Common  = new Common();
                string stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&retid=" + Common.Encrypt(chkList.Value.ToString(), Session.SessionID);
                lnkReturnNo.NavigateUrl = "Default.aspx" + stParam;

                CreditMemoStatus status = (CreditMemoStatus)Enum.Parse(typeof(CreditMemoStatus), dr["CreditMemoStatus"].ToString());
                if (status == CreditMemoStatus.Posted || status == CreditMemoStatus.Cancelled || lnkReturnNo.Text.Substring(0, Constants.SALES_RETURN_CODE.Length) == Constants.SALES_RETURN_CODE)
                {
                    chkList.Attributes.Add("disabled", "false");
                    ImageButton imgItemDelete = (ImageButton)e.Item.FindControl("imgItemDelete");
                    ImageButton imgItemEdit   = (ImageButton)e.Item.FindControl("imgItemEdit");
                    ImageButton imgItemPost   = (ImageButton)e.Item.FindControl("imgItemPost");
                    imgItemDelete.Enabled = false; imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemEdit.Enabled   = false; imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemPost.Enabled   = false; imgItemPost.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                }
                Label lblReturnDate = (Label)e.Item.FindControl("lblReturnDate");
                lblReturnDate.Text = Convert.ToDateTime(dr["CNDate"]).ToString("yyyy-MM-dd HH:mm:ss");

                Label lblCustomerID = (Label)e.Item.FindControl("lblCustomerID");
                lblCustomerID.Text = dr["CustomerID"].ToString();

                HyperLink lblCustomerCode = (HyperLink)e.Item.FindControl("lblCustomerCode");
                lblCustomerCode.Text = dr["CustomerCode"].ToString();
                stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(lblCustomerID.Text, Session.SessionID);
                lblCustomerCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/SalesAndReceivables/_Customer/Default.aspx" + stParam;

                Label lblReqReturnDate = (Label)e.Item.FindControl("lblReqReturnDate");
                lblReqReturnDate.Text = Convert.ToDateTime(dr["RequiredPostingDate"]).ToString("yyyy-MM-dd");

                Label lblBranchID = (Label)e.Item.FindControl("lblBranchID");
                lblBranchID.Text = dr["BranchID"].ToString();
                Label lblBranchCode = (Label)e.Item.FindControl("lblBranchCode");
                lblBranchCode.Text = dr["BranchCode"].ToString();

                Label lblSubTotal = (Label)e.Item.FindControl("lblSubTotal");
                lblSubTotal.Text = Convert.ToDecimal(dr["SubTotal"]).ToString("#,##0.#0");

                Label lblRemarks = (Label)e.Item.FindControl("lblRemarks");
                lblRemarks.Text = dr["Remarks"].ToString();

                //For anchor
                //				HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst");

                //				HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown");
                //				anchorDown.HRef = "javascript:ToggleDiv('" +  divExpCollAsst.ClientID + "')";
            }
        }
コード例 #5
0
ファイル: CreditMemo.cs プロジェクト: marioricci/erp-luma
        public MySqlDataReader List(CreditMemoStatus CreditMemoStatus, string SortField, SortOption SortOrder)
        {
            try
            {
                string SQL = SQLSelect() + "AND CreditMemoStatus = @CreditMemoStatus " +
                            "ORDER BY " + SortField;

                if (SortOrder == SortOption.Ascending)
                    SQL += " ASC";
                else
                    SQL += " DESC";

                

                MySqlCommand cmd = new MySqlCommand();
                
                
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return myReader;
            }
            catch (Exception ex)
            {
                
                
                {
                    
                    
                    
                    
                }

                throw base.ThrowException(ex);
            }
        }
コード例 #6
0
ファイル: CreditMemo.cs プロジェクト: marioricci/erp-luma
        public System.Data.DataTable ListAsDataTable(CreditMemoStatus CreditMemoStatus, string SortField = "CreditMemoID", SortOption SortOrder = SortOption.Ascending)
        {
            string SQL = SQLSelect() + "WHERE CreditMemoStatus = @CreditMemoStatus ORDER BY " + SortField;

            if (SortOrder == SortOption.Ascending)
                SQL += " ASC";
            else
                SQL += " DESC";

            MySqlCommand cmd = new MySqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.CommandText = SQL;

            cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));

            string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
            base.MySqlDataAdapterFill(cmd, dt);

            return dt;
        }
コード例 #7
0
ファイル: CreditMemo.cs プロジェクト: marioricci/erp-luma
        public MySqlDataReader List(CreditMemoStatus CreditMemoStatus, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                string SQL = SQLSelect() + "AND CreditMemoStatus = @CreditMemoStatus " +
                        "AND PostingDate BETWEEN @StartDate AND @EndDate " +
                    "ORDER BY CreditMemoID ASC";

                

                MySqlCommand cmd = new MySqlCommand();
                
                
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@CreditMemoStatus", CreditMemoStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@StartDate", StartDate.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@EndDate", EndDate.ToString("yyyy-MM-dd HH:mm:ss"));

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return myReader;
            }
            catch (Exception ex)
            {
                
                
                {
                    
                    
                    
                    
                }

                throw base.ThrowException(ex);
            }
        }