예제 #1
0
 protected void ASPxCallbackPanel1_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
     if (headerText != null)
     {
         e.Properties.Add("cpHeaderText", headerText);
     }
 }
예제 #2
0
    protected void cmb_Status_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_Status = grd_Do.FindEditFormTemplateControl("cmb_Status") as ASPxComboBox;
        ASPxTextBox  txt_DoNo   = grd_Do.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox;
        string       doNo       = SafeValue.SafeString(txt_DoNo.Text);
        string       sql        = string.Format(@"select DoStatus from Wh_Trans where DoNo='{0}'", doNo);
        string       status     = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");

        if (status == "Confirmed")
        {
            cmb_Status.Text = "Confirmed";
        }
        if (status == "Draft")
        {
            cmb_Status.Text = "Draft";
        }
        if (status == "Closed")
        {
            cmb_Status.Text = "Closed";
        }
        if (status == "Canceled")
        {
            cmb_Status.Text = "Canceled";
        }
    }
    protected void ASPxComboBox1_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ArrayList list = new ArrayList();

        foreach (ListEditItem item in ASPxComboBox1.Items)
        {
            list.Add(item.GetValue("UnitPrice"));
        }
        e.Properties["cpHiddenColumnValues"] = list;
    }
예제 #4
0
    protected void cmb_WorkStatus_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_WorkStatus = grid_Issue.FindEditFormTemplateControl("cmb_WorkStatus") as ASPxComboBox;
        ASPxTextBox  txt_JobNo      = grid_Issue.FindEditFormTemplateControl("txt_JobNo") as ASPxTextBox;
        string       doNo           = SafeValue.SafeString(txt_JobNo.Text);
        string       sql            = string.Format(@"select JobStage from JobSchedule where JobNo='{0}'", doNo);
        string       status         = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");

        if (status == "Job Completion")
        {
            cmb_WorkStatus.Text = "COMPLETE";
        }
    }
예제 #5
0
    protected void cbb_Type_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxLabel    lbl_TotalDays = this.ASPxGridView1.FindEditFormTemplateControl("lbl_TotalDays") as ASPxLabel;
        ASPxLabel    lbl_BalDays   = this.ASPxGridView1.FindEditFormTemplateControl("lbl_BalDays") as ASPxLabel;
        ASPxComboBox cmb_Person    = this.ASPxGridView1.FindEditFormTemplateControl("cmb_Person") as ASPxComboBox;
        ASPxComboBox cbb_Type      = this.ASPxGridView1.FindEditFormTemplateControl("cbb_Type") as ASPxComboBox;
        string       type          = SafeValue.SafeString(cbb_Type.Value);
        int          person        = SafeValue.SafeInt(cmb_Person.Value, 0);
        decimal      res           = C2.HrLeaveTmp.getDays(person, type, DateTime.Now.Year);

        lbl_TotalDays.Text = res.ToString();
        res = C2.HrLeaveTmp.getBalDays(person, type, DateTime.Now.Year);
        lbl_BalDays.Text = res.ToString();
    }
예제 #6
0
    protected void cbb_Type_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        string type = SafeValue.SafeString(cbb_Type.Value);

        if (type == "Location")
        {
            dsUom.FilterExpression  = "CodeType='3'";
            cbb_Location.DataSource = dsUom;
        }
        if (type == "Owner")
        {
            dsUom.FilterExpression  = "CodeType='4'";
            cbb_Location.DataSource = dsUom;
        }
    }
예제 #7
0
        void updatePanel_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
        {
            Page page         = WebWindow.CurrentRequestPage;
            var  updatePanels = new List <XafUpdatePanel>();

            FindUpdatePanels(page, updatePanels);
            var controlNames = new StringBuilder();

            foreach (XafUpdatePanel panel in updatePanels)
            {
                if (!IsParentOf(panel, (Control)sender))
                {
                    controlNames.Append(panel.ClientID);
                    controlNames.Append(";");
                    e.Properties["cp" + panel.ClientID] = RenderUtils.GetControlChildrenRenderResult(panel);
                }
            }

            e.Properties["cpControlsToUpdate"] = controlNames.ToString();
        }
예제 #8
0
    protected void cmb_Status_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_Status = grid_Issue.FindEditFormTemplateControl("cmb_Status") as ASPxComboBox;
        ASPxTextBox  txt_JobNo  = grid_Issue.FindEditFormTemplateControl("txt_JobNo") as ASPxTextBox;
        string       doNo       = SafeValue.SafeString(txt_JobNo.Text);
        string       sql        = string.Format(@"select JobStage from JobSchedule where JobNo='{0}'", doNo);
        string       status     = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");

        if (status == "Haulier Import")
        {
            cmb_Status.Text = "Haulier Import";
        }
        if (status == "Haulier Export")
        {
            cmb_Status.Text = "Haulier Export";
        }
        if (status == "Freight Import")
        {
            cmb_Status.Text = "Freight Import";
        }
        if (status == "Freight Export")
        {
            cmb_Status.Text = "Freight Export";
        }
        if (status == "Transport")
        {
            cmb_Status.Text = "Transport";
        }
        if (status == "Warehouse Receive")
        {
            cmb_Status.Text = "Warehouse Receive";
        }
        if (status == "Warehouse Release")
        {
            cmb_Status.Text = "Warehouse Release";
        }
        if (status == "Misc Job")
        {
            cmb_Status.Text = "Misc Job";
        }
    }
예제 #9
0
    protected void cmb_Customer_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb = sender as ASPxComboBox;

        object[]  name = new object[cmb.Items.Count];
        object[]  term = new object[cmb.Items.Count];
        string    sql  = "select p.Name,t.Code from XXParty p left outer join XXTerm t on p.TermId=t.Code";
        DataTable dt   = C2.Manager.ORManager.GetDataSet(sql).Tables[0];

        for (int i = 0; i < cmb.Items.Count; i++)
        {
            name[i] = cmb.Items[i];
            for (int r = 0; r < dt.Rows.Count; r++)
            {
                if (name[i].ToString() == dt.Rows[r]["Name"].ToString())
                {
                    term[i] = dt.Rows[i]["Code"];
                }
            }
        }
        e.Properties["cpTerm"] = term;
    }
예제 #10
0
    protected void cmb_FromCurrency_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb = sender as ASPxComboBox;

        object[] yahooRate = new object[cmb.Items.Count];
        string   sql       = "";
        //ASPxComboBox _fromCurrency = ASPxGridView1.FindEditRowCellTemplateControl(null, "cmb_FromCurrency") as ASPxComboBox;
        //ASPxComboBox _toCurrency = ASPxGridView1.FindEditRowCellTemplateControl(null, "cmb_ToCurrency") as ASPxComboBox;
        ASPxDateEdit _exRateDate = ASPxGridView1.FindEditRowCellTemplateControl(null, "Date_ExRateDate") as ASPxDateEdit;

        //if (_exRateDate != null && SafeValue.SafeDate(_exRateDate.Date, new DateTime(1753, 01, 01)).ToString("yyyy-MM-dd") == DateTime.Today.ToString("yyyy-MM-dd") && _fromCurrency != null && _toCurrency != null && SafeValue.SafeString(_fromCurrency.Text).Length == 3 && SafeValue.SafeString(_toCurrency.Text).Length == 3)
        //{
        for (int i = 0; i < cmb.Items.Count; i++)
        {
            Stream               objStream;
            StreamReader         objSR;
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");

            string          str         = "http://download.finance.yahoo.com/d/quotes.csv?s=" + cmb.Items[i].Text + System.Configuration.ConfigurationManager.AppSettings["Currency"] + "=X&f=l1";
            HttpWebRequest  wrquest     = (HttpWebRequest)WebRequest.Create(str);
            HttpWebResponse getresponse = null;
            getresponse = (HttpWebResponse)wrquest.GetResponse();

            objStream = getresponse.GetResponseStream();
            objSR     = new StreamReader(objStream, encode, true);
            string strResponse = objSR.ReadToEnd();
            yahooRate[i] = SafeValue.SafeDecimal(strResponse, 0);
        }
        //}
        //else
        //{

        //    for (int i = 0; i < cmb.Items.Count; i++)
        //    {
        //        yahooRate[i] = 0;
        //    }
        //}
        e.Properties["cpYahooRate"] = yahooRate;
    }
예제 #11
0
    protected void cmb_StatusCode_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_Status = ASPxGridView1.FindEditFormTemplateControl("cmb_StatusCode") as ASPxComboBox;
        ASPxTextBox  txt_Id     = ASPxGridView1.FindEditFormTemplateControl("txt_Oid") as ASPxTextBox;
        string       Id         = SafeValue.SafeString(txt_Id.Text);

        if (Id != "")
        {
            string sql    = string.Format(@"select StatusCode from Hr_Payroll where Id={0}", Id);
            string status = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");
            if (status == "Draft")
            {
                cmb_Status.Text = "Draft";
            }
            if (status == "Confirm")
            {
                cmb_Status.Text = "Confirm";
            }
            if (status == "Cancel")
            {
                cmb_Status.Text = "Cancel";
            }
        }
    }
예제 #12
0
    protected void cmb_JobStatus_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_JobStatus = this.grid_job.FindEditFormTemplateControl("cmb_JobStatus") as ASPxComboBox;
        ASPxLabel    Id            = this.grid_job.FindEditFormTemplateControl("lb_Id") as ASPxLabel;
        string       sql           = string.Format(@"select JobStatus from ctm_job where Id='{0}'", Id.Text);
        string       status        = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");

        if (status == "Quoted")
        {
            cmb_JobStatus.Text = "Quoted";
        }
        if (status == "Confirmed")
        {
            cmb_JobStatus.Text = "Confirmed";
        }
        if (status == "Completed")
        {
            cmb_JobStatus.Text = "Completed";
        }
        if (status == "Voided")
        {
            cmb_JobStatus.Text = "Voided";
        }
    }
예제 #13
0
 protected void txtConfirmPassword_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
     e.Properties["cp_myPassword"] = currentPassword;
 }
예제 #14
0
 protected void cmb_JobType_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
     ASPxComboBox cmb_JobType = grid_Issue.FindEditFormTemplateControl("cmb_JobType") as ASPxComboBox;
 }
예제 #15
0
    protected void cmb_ChgCode_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb = sender as ASPxComboBox;

        object[] keyValues = new object[cmb.Items.Count];
        object[] chgCode   = new object[cmb.Items.Count];
        object[] des1      = new object[cmb.Items.Count];
        object[] unit      = new object[cmb.Items.Count];
        object[] acCode    = new object[cmb.Items.Count];
        object[] qty       = new object[cmb.Items.Count];
        object[] price     = new object[cmb.Items.Count];
        object[] gst       = new object[cmb.Items.Count];
        object[] gstType   = new object[cmb.Items.Count];


        string pol = "";
        string pod = "";

        string    sql_ref          = string.Format("select Volumne,JobType,Currency,CustomerId from JobInfo where JobNo=(Select RefNo from Cost where SequenceId='{0}')", SafeValue.SafeInt(txt_Id.Text, 0));
        DataTable mast             = ConnectSql.GetTab(sql_ref);
        string    curr             = SafeValue.SafeString(mast.Rows[0]["Currency"]);
        decimal   oQty             = SafeValue.SafeDecimal(mast.Rows[0]["Volumne"], 0);
        string    filter_FclLclInd = "Local";
        string    filter_ImpExpInd = "";
        string    partyTo          = SafeValue.SafeString(mast.Rows[0]["CustomerId"]);

        if (oQty == 0)
        {
            oQty = 1;
        }
        if (1 == 1)//if (curr.ToUpper() == "SGD" || curr == "USD")
        {
//            if (sql_ref.Length > 0)
//            {
////                string sql = string.Format(@"
////WITH home AS(select SequenceId,ChgCode
////,Case when unit='set' or unit='SHPT' then qty
////     when Amt>0 and {4}*price>=amt then {4}
////     when Amt>0 and {4}*price<amt then 1
////     when Amt=0 and {4}>=Qty then {4}
////     when Amt=0 and {4}<Qty then qty
////     else {4} end as Qty
////,Case when Amt>0 and {4}*price>=amt then price
////     when Amt>0 and {4}*price<amt then amt
////     else price end as Price
////from seaquotedet1 where QuoteId='-1' and FclLclInd='{3}' and (isnull(PartyTo,'')='{0}' or isnull(PartyTo,'')='')
//// and Currency='{6}')
////SELECT Qty,Price,ChgCode FROM home WHERE SequenceId IN (SELECT MAX(SequenceId) FROM home GROUP BY ChgCode)",
////partyTo, pol, pod, filter_FclLclInd, oQty, filter_ImpExpInd, curr);//and ImpExpInd='{5}' and (isnull(Pol,'')='{1}' or isnull(Pol,'')='') and (isnull(Pod,'')='{2}' or isnull(Pod,'')='')

//                string sql = string.Format(@"SELECT * FROM seaquotedet1 where QuoteId='-1' and FclLclInd='{3}' and (isnull(PartyTo,'')='{0}' or isnull(PartyTo,'')='')",
//partyTo, pol, pod, filter_FclLclInd, oQty, filter_ImpExpInd, curr);
//                DataTable dt = C2.Manager.ORManager.GetDataSet(sql).Tables[0];
//                for (int i = 0; i < cmb.Items.Count; i++)
//                {
//                    keyValues[i] = cmb.Items[i].GetValue("SequenceId");
//                    chgCode[i] = cmb.Items[i].GetValue("ChgcodeId");
//                    des1[i] = cmb.Items[i].GetValue("ChgcodeDe");
//                    unit[i] = cmb.Items[i].GetValue("ChgUnit");
//                    acCode[i] = cmb.Items[i].GetValue("ArCode");
//                    gst[i] = cmb.Items[i].GetValue("GstP");
//                    gstType[i] = cmb.Items[i].GetValue("GstTypeId");


//                    for (int r = 0; r < dt.Rows.Count; r++)
//                    {
//                        if (dt.Rows[r]["ChgCode"].ToString() == chgCode[i].ToString())
//                        {
//                            qty[i] = dt.Rows[r]["Qty"];
//                            price[i] = dt.Rows[r]["Price"];
//                        }
//                    }
//                }
//            }
//            else
//            {
//                for (int i = 0; i < cmb.Items.Count; i++)
//                {
//                    keyValues[i] = cmb.Items[i].GetValue("SequenceId");
//                    des1[i] = cmb.Items[i].GetValue("ChgcodeDe");
//                    unit[i] = cmb.Items[i].GetValue("ChgUnit");
//                    acCode[i] = cmb.Items[i].GetValue("ArCode");
//                    gst[i] = cmb.Items[i].GetValue("GstP");
//                    gstType[i] = cmb.Items[i].GetValue("GstTypeId");
//                }
//            }
            for (int i = 0; i < cmb.Items.Count; i++)
            {
                keyValues[i] = cmb.Items[i].GetValue("SequenceId");
                des1[i]      = cmb.Items[i].GetValue("ChgcodeDe");
                unit[i]      = cmb.Items[i].GetValue("ChgUnit");
                acCode[i]    = cmb.Items[i].GetValue("ArCode");
                gst[i]       = cmb.Items[i].GetValue("GstP");
                gstType[i]   = cmb.Items[i].GetValue("GstTypeId");
                if (SafeValue.SafeString(cmb.Items[i].GetValue("ChgUnit")).ToUpper() == "VOL")
                {
                    qty[i] = oQty;
                }
            }
        }
        else
        {
            for (int i = 0; i < cmb.Items.Count; i++)
            {
                keyValues[i] = cmb.Items[i].GetValue("SequenceId");
                des1[i]      = cmb.Items[i].GetValue("ChgcodeDe");
                unit[i]      = cmb.Items[i].GetValue("ChgUnit");
                acCode[i]    = cmb.Items[i].GetValue("ArCode");
                gst[i]       = cmb.Items[i].GetValue("GstP");
                gstType[i]   = cmb.Items[i].GetValue("GstTypeId");
            }
        }
        e.Properties["cpDes1"]      = des1;
        e.Properties["cpUnit"]      = unit;
        e.Properties["cpAcCode"]    = acCode;
        e.Properties["cpQty"]       = qty;
        e.Properties["cpPrice"]     = price;
        e.Properties["cpGst"]       = gst;
        e.Properties["cpGstType"]   = gstType;
        e.Properties["cpKeyValues"] = keyValues;
    }
예제 #16
0
 protected void FileManager_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
     e.Properties["cp_RootFolderRelativePath"] = FileManager.GetAppRelativeRootFolder();
 }
예제 #17
0
 protected void cmb_WorkStatus_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
 }
예제 #18
0
 protected void cbb_Location_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
 }
예제 #19
0
 protected void clbPanelGroups_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
 {
 }