Example #1
0
        public Invoice_Order_Details(int Orderid, int User_Id, string OPERATION, string INV_NUM, string USER_ROLE)
        {
            InitializeComponent();
            userid    = User_Id;
            Operation = OPERATION;
            Order_Id  = Orderid;
            User_Role = USER_ROLE;
            if (User_Role == "1" || userid == 260 || userid == 179)
            {
                dbc.BindClientName(ddl_Client_Search);
            }
            else
            {
                dbc.BindClientNo_for_Report(ddl_Client_Search);
            }

            txt_Production_Date.Text = DateTime.Now.ToString();

            if (Order_Id != 0)
            {
                if (Operation == "Insert")
                {
                    load_order_masters();
                    Order_Load();
                    txt_Invoice_Date.Text            = DateTime.Now.ToString("mm/dd/yyyy");
                    txt_Invoice_Order_Number.Visible = true;
                    lbl_Enter_Order.Visible          = true;
                    Group_Order_Numbers.Enabled      = true;
                    lbl_Invoice.Visible        = false;
                    lbl_Invoice_Number.Visible = false;


                    txt_Production_Date.Text = DateTime.Now.ToString();
                }
                else if (Operation == "Update")
                {
                    txt_Invoice_Order_Number.Visible = false;
                    lbl_Enter_Order.Visible          = false;
                    lbl_Invoice.Visible        = true;
                    lbl_Invoice_Number.Visible = true;
                    btn_Save.Text = "Edit Invoice";
                    Group_Order_Numbers.Enabled = false;
                    Inv_Num = INV_NUM.ToString();
                    load_order_masters();
                    Order_Load();
                    Load_Invoice_Details();
                    if (client_Id == 4 && ddl_State.SelectedValue.ToString() == "31")
                    {
                        txt_CGI_Title_Land_Amount.Visible = false;
                    }
                    lbl_Invoice_Number.Text = Inv_Num.ToString();
                }
            }
        }
        private void Invoice_Monthly_Load(object sender, EventArgs e)
        {
            if (Invoice_Id == 0)
            {
                if (User_Role == "1")
                {
                    dbc.BindClientName(ddl_Client_Name);
                }
                else
                {
                    dbc.BindClientNo_for_Report(ddl_Client_Name);
                }
                txt_From_date.Text    = DateTime.Now.ToString();
                txt_To_date.Text      = DateTime.Now.ToString();
                txt_Invoice_Date.Text = DateTime.Now.ToString();
                btn_Save.Text         = "Genrate Invoice";
                dbc.BindPayment_Status(ddl_Payment_Status);
                Control_Enable_True();
                txt_Old_balance.Text             = "0.00";
                txt_Invoice_Paying_Amount.Text   = "0.00";
                ddl_Payment_Status.SelectedValue = "1";
            }
            else if (Invoice_Id != 0)
            {
                if (User_Role == "1")
                {
                    dbc.BindClientName(ddl_Client_Name);
                }
                else
                {
                    dbc.BindClientNo_for_Report(ddl_Client_Name);
                }

                ddl_Client_Name.SelectedValue = Client_Id;
                ddl_Client_Name_SelectedIndexChanged(sender, e);
                dbc.BindPayment_Status(ddl_Payment_Status);
                ddl_Client_SubProcess.SelectedValue = Sub_Process_ID;
                txt_From_date.Text    = DateTime.Now.ToString();
                txt_To_date.Text      = DateTime.Now.ToString();
                txt_Invoice_Date.Text = DateTime.Now.ToString();
                btn_Save.Text         = "Edit Invoice";

                lbl_Invoice_Number.Text = Invoice_Number.ToString();
                lbl_Inv_Month.Text      = Invoice_Month.ToString();
                //txt_Invoice_Date.Text = Invoice_Date.ToString();
                //txt_Invoice_comments.Text = Invoice_Comments.ToString();
                Control_EnableFalse();
                Load_Invoice_Entred_Order_Details();
            }
        }